4 // some maximum sizes for buffers
\r
5 #define MAX_WD_LEN 200
\r
6 #define MAX_LN_LEN 16384
\r
9 // a meaning with definition, count of synonyms and synonym list
\r
20 int nw; /* number of entries in thesaurus */
\r
21 char** list; /* stores word list */
\r
22 unsigned int* offst; /* stores offset list */
\r
23 char * encoding; /* stores text encoding; */
\r
27 // disallow copy-constructor and assignment-operator for now
\r
29 MyThes(const MyThes &);
\r
30 MyThes & operator = (const MyThes &);
\r
33 MyThes(const char* idxpath, const char* datpath);
\r
36 // lookup text in index and return number of meanings
\r
37 // each meaning entry has a defintion, synonym count and pointer
\r
38 // when complete return the *original* meaning entry and count via
\r
39 // CleanUpAfterLookup to properly handle memory deallocation
\r
41 int Lookup(const char * pText, int len, mentry** pme);
\r
43 void CleanUpAfterLookup(mentry** pme, int nmean);
\r
45 char* get_th_encoding();
\r
48 // Open index and dat files and load list array
\r
49 int thInitialize (const char* indxpath, const char* datpath);
\r
51 // internal close and cleanup dat and idx files
\r
54 // read a text line (\n terminated) stripping off line terminator
\r
55 int readLine(FILE * pf, char * buf, int nc);
\r
57 // binary search on null terminated character strings
\r
58 int binsearch(char * wrd, char* list[], int nlst);
\r
60 // string duplication routine
\r
61 char * mystrdup(const char * p);
\r
63 // remove cross-platform text line end characters
\r
64 void mychomp(char * s);
\r
66 // return index of char in string
\r
67 int mystr_indexOfChar(const char * d, int c);
\r