32 #ifndef ISPELL_CHECKER_H
33 #define ISPELL_CHECKER_H
37 #include <tqstringlist.h>
38 #include <tqvaluelist.h>
39 #include <tqtextcodec.h>
49 bool checkWord(
const TQString& word);
50 TQStringList suggestWord(
const TQString& word);
52 bool requestDictionary (
const char * szLang);
53 static TQValueList<TQString> allDics();
55 ISpellChecker(
const ISpellChecker&);
56 void operator=(
const ISpellChecker&);
58 TQString loadDictionary (
const char * szLang );
59 bool loadDictionaryForLanguage (
const char * szLang );
60 void setDictionaryEncoding (
const TQString& hashname,
const char * enc );
67 void try_autodetect_charset(
const char * inEncoding);
73 int casecmp P ((
char * a,
char * b,
int canonical));
74 void makepossibilities P ((ichar_t * word));
75 int insert P ((ichar_t * word));
76 #ifndef NO_CAPITALIZATION_SUPPORT
77 void wrongcapital P ((ichar_t * word));
79 void wrongletter P ((ichar_t * word));
80 void extraletter P ((ichar_t * word));
81 void missingletter P ((ichar_t * word));
82 void missingspace P ((ichar_t * word));
83 int compoundgood P ((ichar_t * word,
int pfxopts));
84 void transposedletter P ((ichar_t * word));
85 int ins_cap P ((ichar_t * word, ichar_t * pattern));
86 int save_cap P ((ichar_t * word, ichar_t * pattern,
87 ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN]));
88 int ins_root_cap P ((ichar_t * word, ichar_t * pattern,
89 int prestrip,
int preadd,
int sufstrip,
int sufadd,
90 struct dent * firstdent,
struct flagent * pfxent,
91 struct flagent * sufent));
92 void save_root_cap P ((ichar_t * word, ichar_t * pattern,
93 int prestrip,
int preadd,
int sufstrip,
int sufadd,
94 struct dent * firstdent,
struct flagent * pfxent,
95 struct flagent * sufent,
96 ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN],
103 int good (ichar_t* w,
int ignoreflagbits,
int allhits,
int pfxopts,
int sfxopts);
104 void chk_aff (ichar_t* word, ichar_t* ucword,
int len,
int ignoreflagbits,
int allhits,
int pfxopts,
int sfxopts);
106 struct dent * ispell_lookup (ichar_t* s,
int dotree);
107 int strtoichar (ichar_t* out,
char* in,
int outlen,
int canonical);
108 int ichartostr (
char* out, ichar_t* in,
int outlen,
int canonical);
109 char * ichartosstr (ichar_t* in,
int canonical);
110 int findfiletype (
const char * name,
int searchnames,
int * deformatter);
111 long whatcap (ichar_t* word);
118 char myupper(ichar_t c);
119 char mylower(ichar_t c);
120 int myspace(ichar_t c);
121 char iswordch(ichar_t c);
122 char isboundarych(ichar_t c);
123 char isstringstart(ichar_t c);
124 ichar_t mytolower(ichar_t c);
125 ichar_t mytoupper(ichar_t c);
127 #ifndef ICHAR_IS_CHAR
128 int cap_ok (ichar_t* word,
struct success* hit,
int len);
130 int hash (ichar_t* s,
int hashtblsize);
137 void clearindex P ((
struct flagptr * indexp));
138 void initckch P ((
char *));
140 void alloc_ispell_struct();
141 void free_ispell_struct();
147 int addvheader P ((
struct dent * ent));
148 void upcase P ((ichar_t *
string));
149 void lowcase P ((ichar_t *
string));
150 void chupcase P ((
char * s));
152 int stringcharlen P ((
char * bufp,
int canonical));
153 ichar_t * strtosichar P ((
char * in,
int canonical));
154 char * printichar P ((
int in));
160 void pfx_list_chk P ((ichar_t * word, ichar_t * ucword,
161 int len,
int optflags,
int sfxopts,
struct flagptr * ind,
162 int ignoreflagbits,
int allhits));
163 void chk_suf P ((ichar_t * word, ichar_t * ucword,
int len,
164 int optflags,
struct flagent * pfxent,
int ignoreflagbits,
166 void suf_list_chk P ((ichar_t * word, ichar_t * ucword,
int len,
167 struct flagptr * ind,
int optflags,
struct flagent * pfxent,
168 int ignoreflagbits,
int allhits));
169 int expand_pre P ((
char * croot, ichar_t * rootword,
170 MASKTYPE mask[],
int option,
char * extra));
171 int pr_pre_expansion P ((
char * croot, ichar_t * rootword,
172 struct flagent * flent, MASKTYPE mask[],
int option,
174 int expand_suf P ((
char * croot, ichar_t * rootword,
175 MASKTYPE mask[],
int optflags,
int option,
char * extra));
176 int pr_suf_expansion P ((
char * croot, ichar_t * rootword,
177 struct flagent * flent,
int option,
char * extra));
178 void forcelc P ((ichar_t * dst,
int len));
184 bool m_bSuccessfulInit;
205 char m_ctoken[INPUTWORDLEN + MAXAFFIXLEN];
206 ichar_t m_itoken[INPUTWORDLEN + MAXAFFIXLEN];
212 char * m_hashstrings;
219 char m_hashname[MAXPATHLEN];
230 unsigned int m_laststringch;
235 struct flagptr m_pflagindex[SET_SIZE + MAXSTRINGCHARS];
237 struct flagent * m_pflaglist;
238 struct flagptr m_sflagindex[SET_SIZE + MAXSTRINGCHARS];
240 struct flagent * m_sflaglist;
248 char * m_askfilename;
254 #define MAXPOSSIBLE 100
256 char m_possibilities[MAXPOSSIBLE][INPUTWORDLEN + MAXAFFIXLEN];
260 int m_easypossibilities;
268 ichar_t m_Try[SET_SIZE + MAXSTRINGCHARS];
270 TQTextCodec *m_translate_in;