corpmanag.h File Reference

#include "../cl/corpus.h"
#include "../cl/bitfields.h"
#include "cqp.h"
#include "context_descriptor.h"

Data Structures

Typedefs

Enumerations

Functions

Variables


Typedef Documentation

typedef struct cl CorpusList

The CorpusList object records information on a corpus that CQP recognises.

typedef enum corpus_type CorpusType

The CorpusType object.

typedef enum _field_type FieldType

The FieldType object represents the fields (or 'anchor points') of a subcorpus (inc query result).

NoField is always the last field (so it can be used to determine range of field type codes) (the mnemonic is NoField = "no field" = "number of fields")

typedef struct _Range Range

The Range object represents a range of corpus positions.


Enumeration Type Documentation

The FieldType object represents the fields (or 'anchor points') of a subcorpus (inc query result).

NoField is always the last field (so it can be used to determine range of field type codes) (the mnemonic is NoField = "no field" = "number of fields")

Enumerator:
MatchField 
MatchEndField 
TargetField 
KeywordField 
NoField 
enum case_mode

Creates an enumeration for lowercase vs.

uppercase mode.

Enumerator:
LOWER 
UPPER 

Underlying enumeration for CorpusType.

Gives an identifier for each "type" of corpus CQP can deal with.

Enumerator:
UNDEF 

undefined status.

SYSTEM 

system corpus, ie registered corpus

SUB 

subcorpus which was generated by a query.

TEMP 

temporary subcorpus, deleted after query

ALL 

Function Documentation

Boolean access_corpus ( CorpusList cl  ) 
CorpusList* assign_temp_to_sub ( CorpusList tmp,
char *  subname 
)
Boolean change_corpus ( char *  name,
Boolean  silent 
)
void check_available_corpora ( enum corpus_type  ct  ) 
void drop_temp_corpora ( void   ) 
void dropcorpus ( CorpusList cl  ) 
CorpusList* duplicate_corpus ( CorpusList cl,
char *  new_name,
Boolean  force_overwrite 
)
FieldType field_name_to_type ( char *  name  ) 
char* field_type_to_name ( FieldType  field  ) 
CorpusList* findcorpus ( char *  s,
enum corpus_type  type,
int  try_recursive_search 
)

finds the pointer to the corpus with name s (strcmp), no case conversion is done.

NULL is returned when the corpus is not yet present. if "type" is UNDEF, it returns the first corpus with matching name, otherwise the returned corpus has the type "type"

CorpusList* FirstCorpusFromList (  ) 

Gets the CorpusList pointer for the first corpus on the currently-loaded list.

Function for iterating through the list of currently-loaded corpora.

Returns:
The requested CorpusList pointer.

Referenced by do_cqi_corpus_list_corpora(), do_cqi_cqp_list_subcorpora(), and main().

void free_corpuslist ( void   ) 

Frees the global list of currently-loaded corpora.

This function sets the corpus list to NULL and frees all members of the list.

References initialize_cl(), cl::next, set_current_corpus(), and True.

Referenced by CorpusListFree().

void init_corpuslist ( void   ) 

Initialises the global corpus list (sets it to NULL, no matter what its value was).

References set_current_corpus().

Referenced by CorpusListInit().

Boolean is_qualified ( char *  corpusname  ) 

References COLON.

Referenced by CorpusNameQualified(), do_undump(), and in_CorpusCommand().

CorpusList* make_temp_corpus ( CorpusList cl,
char *  new_name 
)
CorpusList* NextCorpusFromList ( CorpusList cl  ) 

Gets the CorpusList pointer for the next corpus on the currently-loaded list.

Function for iterating through the list of currently-loaded corpora.

Parameters:
cl The current corpus on the list.
Returns:
The requested CorpusList pointer.

References cl::next.

Referenced by do_cqi_corpus_list_corpora(), do_cqi_cqp_list_subcorpora(), and main().

int NrFieldValues ( CorpusList cl,
FieldType  ft 
)
Boolean save_subcorpus ( CorpusList cl,
char *  fname 
)
void save_unsaved_subcorpora (  ) 
int set_current_corpus ( CorpusList cp,
int  force 
)

Sets the current corpus (by pointer to the corpus).

Also, execustes Xkwic side effects, if necessary

Parameters:
cp Pointer to the corpus to set as current. cp may be NULL, which is legal.
force If true, the current corpus is set to the specified corpus, even if it is ALREADY set to that corpus.
Returns:
Always 1.

References _context_description_block::attributes, CD, cl::corpus, current_corpus, DEFAULT_ATT_NAME, DestroyAttributeList(), FindInAL(), _attlist::list, _attrbuf::next, _attrbuf::status, _context_description_block::strucAttributes, and update_context_descriptor().

Referenced by after_CorpusCommand(), change_corpus(), check_available_corpora(), CorpusSetCurrent(), cqi_activate_corpus(), dropcorpus(), free_corpuslist(), init_corpuslist(), and set_current_corpus_name().

int set_current_corpus_name ( char *  name,
int  force 
)

Sets the current corpus (by name).

Also, execustes Xkwic side effects, if necessary.

Parameters:
name Name of the corpus to set as current.
force If true, the current corpus is set to the specified corpus, even if it is ALREADY set to that corpus.
Returns:
True if the corpus was found and set, otherwise false if the corpus could not be found.

References findcorpus(), set_current_corpus(), and UNDEF.

Referenced by CorpusSetCurrentByname(), and initialize_cqp().

void show_corpora_files ( enum corpus_type  type  ) 

References show_corpora_files1(), SUB, SYSTEM, and UNDEF.

Referenced by CorpusShowNames().

char* split_subcorpus_name ( char *  corpusname,
char *  mother_name 
)

Splits a query result corpus-name into qualifier and local name.

This function splits query result name {corpusname} into qualifier (name of mother corpus) and local name; returns pointer to local name part, or NULL if {corpusname} is not syntactically valid; if mother_name is not NULL, it must point to a buffer of suitable length (MAX_LINE_LENGTH is sufficient) where the qualifier will be stored (empty string for unqualified corpus, and return value == {corpusname} in this case)

References COLON.

Referenced by do_undump(), and valid_subcorpus_name().

Boolean touch_corpus ( CorpusList cp  ) 

Touches a corpus, ie, marks it as changed.

Parameters:
cp The corpus to touch. This must be of type SUB.
Returns:
Boolean: true if the touch worked, otherwise false.

References False, cl::needs_update, cl::saved, SUB, True, and cl::type.

Referenced by CorpusTouch(), delete_intervals(), do_cut(), evaluate_target(), findcorpus(), RangeSetop(), set_target(), SortSubcorpus(), and SortSubcorpusRandomize().

Boolean valid_subcorpus_name ( char *  corpusname  ) 

References False, split_subcorpus_name(), and True.

Referenced by do_undump().


Variable Documentation

Global pointer to the head of CQP's linked list of corpora.


Generated on Sun Feb 28 18:08:04 2010 for CWB by  doxygen 1.6.1