Data Structures | |
struct | entryStruct |
Typedefs | |
typedef entryStruct * | dbEntry |
Functions | |
Boolean | dbAvailable (void) |
Boolean | dbClose (void) |
void | dbFinalize (void) |
List | dbGetEntries (String word) |
void | dbInitialize (void) |
Boolean | dbLoad (String key) |
Boolean | dbLoadAll (List forms) |
Boolean | dbLoadEntries (List entries) |
Boolean | dbOpen (String name) |
Boolean | dbOpenCdgFile (String filename) |
Boolean | dbOpenIndexFile (String filename) |
dbEntry | newDbEntry () |
Variables | |
FILE * | cdgstream |
DB * | database |
time_t | dbAge |
String | dbFileName |
String | dbIndexName |
Hashtable | done = NULL |
String | tmpFilename = NULL |
|
a pointer to the entryStruct Definition at line 85 of file cdgdb.c. Referenced by dbGetEntries(), dbLoadEntries(), and newDbEntry(). |
|
checks if there is a database handle available.
References CDG_WARNING, cdgPrintf(), database, dbAge, dbClose(), dbFileName, dbIndexName, dbOpenCdgFile(), dbOpenIndexFile(), FALSE, and TRUE. Referenced by cmdAnno2Parse(), dbFinalize(), dbLoad(), and dbLoadAll(). |
|
close the database. writes database to disk and closes it.
References CDG_ERROR, cdgPrintf(), database, FALSE, NULL, and TRUE. Referenced by cmdCloseDB(), dbAvailable(), and dbFinalize(). |
|
finalize close the database, delete done hash, remove temporary file Definition at line 457 of file cdgdb.c. References dbAvailable(), dbClose(), done, and tmpFilename. Referenced by cdgFinalize(). |
|
gets lexical entries from the database. gets a result list of LexiconItem matching the given word (the key) from the database. This function succeeds only once for a given word form.
References CDG_ERROR, cdgPrintf(), database, dbEntry, entryStruct::key, newDbEntry(), NULL, entryStruct::oBegin, and entryStruct::oEnd. Referenced by dbLoad(), and dbLoadAll(). |
|
Initialize Definition at line 447 of file cdgdb.c. References done. Referenced by cdgInitialize(). |
|
wrapper for dbLoadEntries(). generates a temp file which holds lexical entries and parses them into the memory
References CDG_INFO, cdgPrintf(), dbAvailable(), dbGetEntries(), dbLoadEntries(), done, FALSE, NULL, and TRUE. |
|
Another wrapper for dbLoadEntries(). It loads all known lexicon items for words in the list FORMS. This has exactly the same effect as calling dbLoad() repeatedly, but is faster because there will be only one file system operation instead of n. Definition at line 415 of file cdgdb.c. References CDG_INFO, CDG_PROGRESS, cdgPrintf(), dbAvailable(), dbGetEntries(), dbLoadEntries(), done, FALSE, NULL, and TRUE. Referenced by cmdAnno2Parse(). |
|
loads lexical entries into the memory. generates a temp file which holds lexical entries and parses them into the memory
References CDG_ERROR, CDG_INFO, cdgPrintf(), cdgstream, dbEntry, FALSE, hkVerbosity, NULL, entryStruct::oBegin, entryStruct::oEnd, tmpFilename, and TRUE. Referenced by dbLoad(), and dbLoadAll(). |
|
Open the data base. NAME is the base name of the cdg and the index file. Definition at line 182 of file cdgdb.c. References CDG_ERROR, cdgPrintf(), dbFileName, dbIndexName, dbOpenCdgFile(), dbOpenIndexFile(), FALSE, NULL, and TRUE. Referenced by cmdUseLexicon(). |
|
open the cdg file. opens the cdg file, which the database is indexing you have to ensure that it is the right one, otherwise you will get crap
References cdgstream, database, dbAge, dbFileName, and NULL. Referenced by dbAvailable(), and dbOpen(). |
|
opens a database. this function opens a database, specified by the parameter 'filename' and stores the handle in the static variable 'database'. If there is no database file with this filename, a new database is created.
References CDG_ERROR, cdgPrintf(), database, dbIndexName, FALSE, NULL, and TRUE. Referenced by dbAvailable(), and dbOpen(). |
|
constructor for dbEntry objects.
References dbEntry, entryStruct::key, NULL, entryStruct::oBegin, and entryStruct::oEnd. Referenced by dbGetEntries(). |
|
the underlying cdg file. This is actually the file, where the lexical entries are stored in. Definition at line 56 of file cdgdb.c. Referenced by dbLoadEntries(), and dbOpenCdgFile(). |
|
database handle. The handle to the database struct Definition at line 52 of file cdgdb.c. Referenced by dbAvailable(), dbClose(), dbGetEntries(), dbOpenCdgFile(), and dbOpenIndexFile(). |
|
age of that file at the time of the last opening Definition at line 65 of file cdgdb.c. Referenced by dbAvailable(), and dbOpenCdgFile(). |
|
file name of the file with CDG input in it Definition at line 59 of file cdgdb.c. Referenced by dbAvailable(), dbOpen(), and dbOpenCdgFile(). |
|
file name of the index Definition at line 62 of file cdgdb.c. Referenced by dbAvailable(), dbOpen(), and dbOpenIndexFile(). |
|
table of words already loaded. Holds the word which are yet retrieved from the database, so that the database won't be questioned for them Definition at line 73 of file cdgdb.c. Referenced by dbFinalize(), dbInitialize(), dbLoad(), and dbLoadAll(). |
|
the filename of the temporary file. This temporary file will contain a set of lexical entries that can then be parsed into the memory. Definition at line 69 of file cdgdb.c. Referenced by dbFinalize(), and dbLoadEntries(). |