cwb-makeall.c File Reference

#include "../cl/globals.h"
#include "../cl/corpus.h"
#include "../cl/attributes.h"
#include "../cl/endian.h"
#include "../cl/fileutils.h"

Functions

Variables


Function Documentation

int component_ok ( Attribute attr,
ComponentID  cid 
)

Checks whether a component has already been created.

Parameters:
attr The attribute of the component to check.
cid The component ID of the component to check.
Returns:
RUE iff the component has already been created.

References component_state(), ComponentDefined, ComponentLoaded, and ComponentUnloaded.

Referenced by do_attribute(), and make_component().

void do_attribute ( Attribute attr,
ComponentID  cid,
int  validate 
)

Create a given component (or all components) for an attribute.

Parameters:
attr The attribute to work on.
cid If this is CompLast, all components will be created. Otherwise, it specifies the single component that will be created.
validate boolean - if true, validate_revcorp is called to check the resulting revcorp.

References _Attribute::any, cid_name(), CompCompRF, CompCompRFX, CompCorpus, CompCorpusFreqs, CompHuffCodes, CompHuffSeq, CompHuffSync, CompLast, CompLexicon, CompLexiconIdx, CompLexiconSrt, component_ok(), CompRevCorpus, CompRevCorpusIdx, is_directory(), make_component(), and validate_revcorp().

Referenced by main().

int main ( int  argc,
char **  argv 
)
void make_component ( Attribute attr,
ComponentID  cid 
)

Creates a component for the specified attribute.

This function will create the component if it doesn't already exist; it aborts on error.

See also:
create_component
Parameters:
attr The attribute of the component to create.
cid The component ID of the component to create.

References cid_name(), component_ok(), component_state(), ComponentLoaded, ComponentUnloaded, and create_component().

Referenced by do_attribute().

void usage ( void   ) 

Prints a usage message and exits the program.

References progname.

int validate_revcorp ( Attribute attr  ) 

Validates the REVCORP component of the given attribute.

This function validates a REVCORP (i.e. an uncompressed index). It assumes that a lexicon, frequencies and (compressed or uncompressed) token stream are available for CL access for the given attribute.

Parameters:
attr The attribute whose REVCORP should be checked.
Returns:
True for all OK, false for a problem.

References cid_name(), cl_calloc(), cl_cpos2id, cl_free, cl_id2freq, cl_max_cpos, cl_max_id, CompRevCorpus, TMblob::data, TComponent::data, ensure_component(), and TComponent::size.

Referenced by do_attribute().


Variable Documentation

The corpus we are working on.

char* progname = NULL

Name of this program.


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