Class for storage and retrieval of raw lexical-class frequencies.
Classes | |
struct | LexClassEqual |
struct | LexClassHash |
Public Types | |
typedef mootLexfreqs::LexfreqSubtable | ClassfreqSubtable |
typedef mootLexfreqs::LexfreqEntry | ClassfreqEntry |
typedef mootTagSet | LexClass |
typedef hash_map< LexClass, ClassfreqEntry, LexClassHash, LexClassEqual > | ClassfreqTable |
typedef hash_map< mootTagString, CountT > | TagfreqTable |
Public Member Functions | |
mootClassfreqs (size_t initial_bucket_count=0) | |
~mootClassfreqs () | |
void | clear (void) |
void | add_count (const LexClass &lclass, const mootTagString &tag, const CountT count) |
const CountT | taglookup (const mootTagString &tag) const |
size_t | n_pairs (void) |
size_t | n_impossible (void) |
bool | load (const char *filename) |
bool | load (FILE *file, const char *filename=__null) |
bool | save (const char *filename) |
bool | save (FILE *file, const char *filename=__null) |
Public Attributes | |
ClassfreqTable | lctable |
TagfreqTable | tagtable |
CountT | totalcount |
Type for class-frequency lookup subtables. map: tagid->c(tokid,tagid)
Type for frequency lookup table entries.
Type for a lexical class ("ambiguity set")
typedef hash_map<LexClass, ClassfreqEntry, LexClassHash, LexClassEqual> moot::mootClassfreqs::ClassfreqTable |
Type for the lexical-class frequency lookup table.
typedef hash_map<mootTagString,CountT> moot::mootClassfreqs::TagfreqTable |
Lookup table: tag->Count(tag)
|
inline |
Default constructor
|
inline |
Default destructor
References clear().
void moot::mootClassfreqs::clear | ( | void | ) |
Clear internal table(s)
Referenced by moot::mootHMMTrainer::clear(), and ~mootClassfreqs().
|
inline |
Add 'count' to the current count for (lclass,tag)
|
inline |
References load(), n_impossible(), n_pairs(), and save().
size_t moot::mootClassfreqs::n_pairs | ( | void | ) |
Return the number of distinct (class,tag) pairs we've counted.
Referenced by taglookup().
size_t moot::mootClassfreqs::n_impossible | ( | void | ) |
Return total number of 'impossible' (class,tag) pairs we've counted. Defined as:
Referenced by taglookup().
bool moot::mootClassfreqs::load | ( | const char * | filename | ) |
Load data from a text-format parameter file
Referenced by taglookup().
bool moot::mootClassfreqs::load | ( | FILE * | file, |
const char * | filename = __null |
||
) |
Load data from a text-format parameter file (stream version)
bool moot::mootClassfreqs::save | ( | const char * | filename | ) |
Save data to a text-format paramater file
Referenced by taglookup().
bool moot::mootClassfreqs::save | ( | FILE * | file, |
const char * | filename = __null |
||
) |
Save data to a text-format paramater file (stream version)
ClassfreqTable moot::mootClassfreqs::lctable |
lexeme->(tag->count) lookup table
TagfreqTable moot::mootClassfreqs::tagtable |
tag->count lookup table
CountT moot::mootClassfreqs::totalcount |
Sum of all counts