31 #ifndef ISPELL_CHECKER_H
32 #define ISPELL_CHECKER_H
36 #include <tqstringlist.h>
37 #include <tqvaluelist.h>
38 #include <tqtextcodec.h>
48 bool checkWord(
const TQString& word);
49 TQStringList suggestWord(
const TQString& word);
51 bool requestDictionary (
const char * szLang);
52 static TQValueList<TQString> allDics();
54 ISpellChecker(
const ISpellChecker&);
55 void operator=(
const ISpellChecker&);
57 TQString loadDictionary (
const char * szLang );
58 bool loadDictionaryForLanguage (
const char * szLang );
59 void setDictionaryEncoding (
const TQString& hashname,
const char * enc );
66 void try_autodetect_charset(
const char * inEncoding);
72 int casecmp P ((
char * a,
char * b,
int canonical));
73 void makepossibilities P ((ichar_t * word));
74 int insert P ((ichar_t * word));
75 #ifndef NO_CAPITALIZATION_SUPPORT
76 void wrongcapital P ((ichar_t * word));
78 void wrongletter P ((ichar_t * word));
79 void extraletter P ((ichar_t * word));
80 void missingletter P ((ichar_t * word));
81 void missingspace P ((ichar_t * word));
82 int compoundgood P ((ichar_t * word,
int pfxopts));
83 void transposedletter P ((ichar_t * word));
84 int ins_cap P ((ichar_t * word, ichar_t * pattern));
85 int save_cap P ((ichar_t * word, ichar_t * pattern,
86 ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN]));
87 int ins_root_cap P ((ichar_t * word, ichar_t * pattern,
88 int prestrip,
int preadd,
int sufstrip,
int sufadd,
89 struct dent * firstdent,
struct flagent * pfxent,
90 struct flagent * sufent));
91 void save_root_cap P ((ichar_t * word, ichar_t * pattern,
92 int prestrip,
int preadd,
int sufstrip,
int sufadd,
93 struct dent * firstdent,
struct flagent * pfxent,
94 struct flagent * sufent,
95 ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN],
102 int good (ichar_t* w,
int ignoreflagbits,
int allhits,
int pfxopts,
int sfxopts);
103 void chk_aff (ichar_t* word, ichar_t* ucword,
int len,
int ignoreflagbits,
int allhits,
int pfxopts,
int sfxopts);
105 struct dent * ispell_lookup (ichar_t* s,
int dotree);
106 int strtoichar (ichar_t* out,
char* in,
int outlen,
int canonical);
107 int ichartostr (
char* out, ichar_t* in,
int outlen,
int canonical);
108 char * ichartosstr (ichar_t* in,
int canonical);
109 int findfiletype (
const char * name,
int searchnames,
int * deformatter);
110 long whatcap (ichar_t* word);
117 char myupper(ichar_t c);
118 char mylower(ichar_t c);
119 int myspace(ichar_t c);
120 char iswordch(ichar_t c);
121 char isboundarych(ichar_t c);
122 char isstringstart(ichar_t c);
123 ichar_t mytolower(ichar_t c);
124 ichar_t mytoupper(ichar_t c);
126 #ifndef ICHAR_IS_CHAR
127 int cap_ok (ichar_t* word,
struct success* hit,
int len);
129 int hash (ichar_t* s,
int hashtblsize);
136 void clearindex P ((
struct flagptr * indexp));
137 void initckch P ((
char *));
139 void alloc_ispell_struct();
140 void free_ispell_struct();
146 int addvheader P ((
struct dent * ent));
147 void upcase P ((ichar_t *
string));
148 void lowcase P ((ichar_t *
string));
149 void chupcase P ((
char * s));
151 int stringcharlen P ((
char * bufp,
int canonical));
152 ichar_t * strtosichar P ((
char * in,
int canonical));
153 char * printichar P ((
int in));
159 void pfx_list_chk P ((ichar_t * word, ichar_t * ucword,
160 int len,
int optflags,
int sfxopts,
struct flagptr * ind,
161 int ignoreflagbits,
int allhits));
162 void chk_suf P ((ichar_t * word, ichar_t * ucword,
int len,
163 int optflags,
struct flagent * pfxent,
int ignoreflagbits,
165 void suf_list_chk P ((ichar_t * word, ichar_t * ucword,
int len,
166 struct flagptr * ind,
int optflags,
struct flagent * pfxent,
167 int ignoreflagbits,
int allhits));
168 int expand_pre P ((
char * croot, ichar_t * rootword,
169 MASKTYPE mask[],
int option,
char * extra));
170 int pr_pre_expansion P ((
char * croot, ichar_t * rootword,
171 struct flagent * flent, MASKTYPE mask[],
int option,
173 int expand_suf P ((
char * croot, ichar_t * rootword,
174 MASKTYPE mask[],
int optflags,
int option,
char * extra));
175 int pr_suf_expansion P ((
char * croot, ichar_t * rootword,
176 struct flagent * flent,
int option,
char * extra));
177 void forcelc P ((ichar_t * dst,
int len));
183 bool m_bSuccessfulInit;
204 char m_ctoken[INPUTWORDLEN + MAXAFFIXLEN];
205 ichar_t m_itoken[INPUTWORDLEN + MAXAFFIXLEN];
211 char * m_hashstrings;
218 char m_hashname[MAXPATHLEN];
229 unsigned int m_laststringch;
234 struct flagptr m_pflagindex[SET_SIZE + MAXSTRINGCHARS];
236 struct flagent * m_pflaglist;
237 struct flagptr m_sflagindex[SET_SIZE + MAXSTRINGCHARS];
239 struct flagent * m_sflaglist;
247 char * m_askfilename;
253 #define MAXPOSSIBLE 100
255 char m_possibilities[MAXPOSSIBLE][INPUTWORDLEN + MAXAFFIXLEN];
259 int m_easypossibilities;
267 ichar_t m_Try[SET_SIZE + MAXSTRINGCHARS];
269 TQTextCodec *m_translate_in;