51 QObject |
51 QObject |
52 <h3>Class Attributes</h3> |
52 <h3>Class Attributes</h3> |
53 <table> |
53 <table> |
54 <tr><td>_spelling_dict</td></tr><tr><td>_spelling_lang</td></tr> |
54 <tr><td>_spelling_dict</td></tr><tr><td>_spelling_lang</td></tr> |
55 </table> |
55 </table> |
|
56 <h3>Class Methods</h3> |
|
57 <table> |
|
58 <tr> |
|
59 <td><a href="#SpellChecker._getDict">_getDict</a></td> |
|
60 <td>Protected classmethod to get a new dictionary.</td> |
|
61 </tr><tr> |
|
62 <td><a href="#SpellChecker.getAvailableLanguages">getAvailableLanguages</a></td> |
|
63 <td>Public classmethod to get all available languages.</td> |
|
64 </tr><tr> |
|
65 <td><a href="#SpellChecker.isAvailable">isAvailable</a></td> |
|
66 <td>Public classmethod to check, if spellchecking is available.</td> |
|
67 </tr><tr> |
|
68 <td><a href="#SpellChecker.setDefaultLanguage">setDefaultLanguage</a></td> |
|
69 <td>Public classmethod to set the default language.</td> |
|
70 </tr> |
|
71 </table> |
56 <h3>Methods</h3> |
72 <h3>Methods</h3> |
57 <table> |
73 <table> |
58 <tr> |
74 <tr> |
59 <td><a href="#SpellChecker.__init__">SpellChecker</a></td> |
75 <td><a href="#SpellChecker.__init__">SpellChecker</a></td> |
60 <td>Constructor</td> |
76 <td>Constructor</td> |
72 <td>Private method to create an iterator.</td> |
88 <td>Private method to create an iterator.</td> |
73 </tr><tr> |
89 </tr><tr> |
74 <td><a href="#SpellChecker.__next__">__next__</a></td> |
90 <td><a href="#SpellChecker.__next__">__next__</a></td> |
75 <td>Public method to advance to the next error.</td> |
91 <td>Public method to advance to the next error.</td> |
76 </tr><tr> |
92 </tr><tr> |
77 <td><a href="#SpellChecker._getDict">_getDict</a></td> |
|
78 <td>Protected classmethod to get a new dictionary.</td> |
|
79 </tr><tr> |
|
80 <td><a href="#SpellChecker.add">add</a></td> |
93 <td><a href="#SpellChecker.add">add</a></td> |
81 <td>Public method to add a word to the personal word list.</td> |
94 <td>Public method to add a word to the personal word list.</td> |
82 </tr><tr> |
95 </tr><tr> |
83 <td><a href="#SpellChecker.checkCurrentPage">checkCurrentPage</a></td> |
96 <td><a href="#SpellChecker.checkCurrentPage">checkCurrentPage</a></td> |
84 <td>Private method to check the currently visible page.</td> |
97 <td>Private method to check the currently visible page.</td> |
99 <td>Public method to check the word at position pos.</td> |
112 <td>Public method to check the word at position pos.</td> |
100 </tr><tr> |
113 </tr><tr> |
101 <td><a href="#SpellChecker.clearAll">clearAll</a></td> |
114 <td><a href="#SpellChecker.clearAll">clearAll</a></td> |
102 <td>Public method to clear all spelling markers.</td> |
115 <td>Public method to clear all spelling markers.</td> |
103 </tr><tr> |
116 </tr><tr> |
104 <td><a href="#SpellChecker.getAvailableLanguages">getAvailableLanguages</a></td> |
|
105 <td>Public classmethod to get all available languages.</td> |
|
106 </tr><tr> |
|
107 <td><a href="#SpellChecker.getContext">getContext</a></td> |
117 <td><a href="#SpellChecker.getContext">getContext</a></td> |
108 <td>Public method to get the context of a faulty word.</td> |
118 <td>Public method to get the context of a faulty word.</td> |
109 </tr><tr> |
119 </tr><tr> |
110 <td><a href="#SpellChecker.getError">getError</a></td> |
120 <td><a href="#SpellChecker.getError">getError</a></td> |
111 <td>Public method to get information about the last error found.</td> |
121 <td>Public method to get information about the last error found.</td> |
120 <td>Public method to tell the checker, to always ignore the given word or the current word.</td> |
130 <td>Public method to tell the checker, to always ignore the given word or the current word.</td> |
121 </tr><tr> |
131 </tr><tr> |
122 <td><a href="#SpellChecker.initCheck">initCheck</a></td> |
132 <td><a href="#SpellChecker.initCheck">initCheck</a></td> |
123 <td>Public method to initialize a spell check.</td> |
133 <td>Public method to initialize a spell check.</td> |
124 </tr><tr> |
134 </tr><tr> |
125 <td><a href="#SpellChecker.isAvailable">isAvailable</a></td> |
|
126 <td>Public classmethod to check, if spellchecking is available.</td> |
|
127 </tr><tr> |
|
128 <td><a href="#SpellChecker.remove">remove</a></td> |
135 <td><a href="#SpellChecker.remove">remove</a></td> |
129 <td>Public method to add a word to the personal exclude list.</td> |
136 <td>Public method to add a word to the personal exclude list.</td> |
130 </tr><tr> |
137 </tr><tr> |
131 <td><a href="#SpellChecker.replace">replace</a></td> |
138 <td><a href="#SpellChecker.replace">replace</a></td> |
132 <td>Public method to tell the checker to replace the current word with the replacement string.</td> |
139 <td>Public method to tell the checker to replace the current word with the replacement string.</td> |
133 </tr><tr> |
140 </tr><tr> |
134 <td><a href="#SpellChecker.replaceAlways">replaceAlways</a></td> |
141 <td><a href="#SpellChecker.replaceAlways">replaceAlways</a></td> |
135 <td>Public method to tell the checker to always replace the current word with the replacement string.</td> |
142 <td>Public method to tell the checker to always replace the current word with the replacement string.</td> |
136 </tr><tr> |
|
137 <td><a href="#SpellChecker.setDefaultLanguage">setDefaultLanguage</a></td> |
|
138 <td>Public classmethod to set the default language.</td> |
|
139 </tr><tr> |
143 </tr><tr> |
140 <td><a href="#SpellChecker.setLanguage">setLanguage</a></td> |
144 <td><a href="#SpellChecker.setLanguage">setLanguage</a></td> |
141 <td>Public method to set the current language.</td> |
145 <td>Public method to set the current language.</td> |
142 </tr><tr> |
146 </tr><tr> |
143 <td><a href="#SpellChecker.setMinimumWordSize">setMinimumWordSize</a></td> |
147 <td><a href="#SpellChecker.setMinimumWordSize">setMinimumWordSize</a></td> |
145 </tr><tr> |
149 </tr><tr> |
146 <td><a href="#SpellChecker.stopIncrementalCheck">stopIncrementalCheck</a></td> |
150 <td><a href="#SpellChecker.stopIncrementalCheck">stopIncrementalCheck</a></td> |
147 <td>Public method to stop an incremental check.</td> |
151 <td>Public method to stop an incremental check.</td> |
148 </tr> |
152 </tr> |
149 </table> |
153 </table> |
150 <a NAME="SpellChecker.__init__" ID="SpellChecker.__init__"></a> |
154 <h3>Static Methods</h3> |
|
155 <table> |
|
156 <tr><td>None</td></tr> |
|
157 </table> |
|
158 <a NAME="SpellChecker._getDict" ID="SpellChecker._getDict"></a> |
|
159 <h4>SpellChecker._getDict (class method)</h4> |
|
160 <b>_getDict</b>(<i>lang, pwl = "", pel = ""</i>) |
|
161 <p> |
|
162 Protected classmethod to get a new dictionary. |
|
163 </p><dl> |
|
164 <dt><i>lang</i></dt> |
|
165 <dd> |
|
166 the language to be used as the default (string). |
|
167 The string should be in language locale format (e.g. en_US, de). |
|
168 </dd><dt><i>pwl=</i></dt> |
|
169 <dd> |
|
170 name of the personal/project word list (string) |
|
171 </dd><dt><i>pel=</i></dt> |
|
172 <dd> |
|
173 name of the personal/project exclude list (string) |
|
174 </dd> |
|
175 </dl><dl> |
|
176 <dt>Returns:</dt> |
|
177 <dd> |
|
178 reference to the dictionary (enchant.Dict) |
|
179 </dd> |
|
180 </dl><a NAME="SpellChecker.getAvailableLanguages" ID="SpellChecker.getAvailableLanguages"></a> |
|
181 <h4>SpellChecker.getAvailableLanguages (class method)</h4> |
|
182 <b>getAvailableLanguages</b>(<i></i>) |
|
183 <p> |
|
184 Public classmethod to get all available languages. |
|
185 </p><dl> |
|
186 <dt>Returns:</dt> |
|
187 <dd> |
|
188 list of available languages (list of strings) |
|
189 </dd> |
|
190 </dl><a NAME="SpellChecker.isAvailable" ID="SpellChecker.isAvailable"></a> |
|
191 <h4>SpellChecker.isAvailable (class method)</h4> |
|
192 <b>isAvailable</b>(<i></i>) |
|
193 <p> |
|
194 Public classmethod to check, if spellchecking is available. |
|
195 </p><dl> |
|
196 <dt>Returns:</dt> |
|
197 <dd> |
|
198 flag indicating availability (boolean) |
|
199 </dd> |
|
200 </dl><a NAME="SpellChecker.setDefaultLanguage" ID="SpellChecker.setDefaultLanguage"></a> |
|
201 <h4>SpellChecker.setDefaultLanguage (class method)</h4> |
|
202 <b>setDefaultLanguage</b>(<i>language</i>) |
|
203 <p> |
|
204 Public classmethod to set the default language. |
|
205 </p><dl> |
|
206 <dt><i>language</i></dt> |
|
207 <dd> |
|
208 the language to be used as the default (string). |
|
209 The string should be in language locale format (e.g. en_US, de). |
|
210 </dd> |
|
211 </dl><a NAME="SpellChecker.__init__" ID="SpellChecker.__init__"></a> |
151 <h4>SpellChecker (Constructor)</h4> |
212 <h4>SpellChecker (Constructor)</h4> |
152 <b>SpellChecker</b>(<i>editor, indicator, defaultLanguage = None, checkRegion = None</i>) |
213 <b>SpellChecker</b>(<i>editor, indicator, defaultLanguage = None, checkRegion = None</i>) |
153 <p> |
214 <p> |
154 Constructor |
215 Constructor |
155 </p><dl> |
216 </p><dl> |
217 </p><dl> |
278 </p><dl> |
218 <dt>Returns:</dt> |
279 <dt>Returns:</dt> |
219 <dd> |
280 <dd> |
220 self |
281 self |
221 </dd> |
282 </dd> |
222 </dl><a NAME="SpellChecker._getDict" ID="SpellChecker._getDict"></a> |
|
223 <h4>SpellChecker._getDict</h4> |
|
224 <b>_getDict</b>(<i>lang, pwl = "", pel = ""</i>) |
|
225 <p> |
|
226 Protected classmethod to get a new dictionary. |
|
227 </p><dl> |
|
228 <dt><i>lang</i></dt> |
|
229 <dd> |
|
230 the language to be used as the default (string). |
|
231 The string should be in language locale format (e.g. en_US, de). |
|
232 </dd><dt><i>pwl=</i></dt> |
|
233 <dd> |
|
234 name of the personal/project word list (string) |
|
235 </dd><dt><i>pel=</i></dt> |
|
236 <dd> |
|
237 name of the personal/project exclude list (string) |
|
238 </dd> |
|
239 </dl><dl> |
|
240 <dt>Returns:</dt> |
|
241 <dd> |
|
242 reference to the dictionary (enchant.Dict) |
|
243 </dd> |
|
244 </dl><a NAME="SpellChecker.add" ID="SpellChecker.add"></a> |
283 </dl><a NAME="SpellChecker.add" ID="SpellChecker.add"></a> |
245 <h4>SpellChecker.add</h4> |
284 <h4>SpellChecker.add</h4> |
246 <b>add</b>(<i>word = None</i>) |
285 <b>add</b>(<i>word = None</i>) |
247 <p> |
286 <p> |
248 Public method to add a word to the personal word list. |
287 Public method to add a word to the personal word list. |
301 </dl><a NAME="SpellChecker.clearAll" ID="SpellChecker.clearAll"></a> |
340 </dl><a NAME="SpellChecker.clearAll" ID="SpellChecker.clearAll"></a> |
302 <h4>SpellChecker.clearAll</h4> |
341 <h4>SpellChecker.clearAll</h4> |
303 <b>clearAll</b>(<i></i>) |
342 <b>clearAll</b>(<i></i>) |
304 <p> |
343 <p> |
305 Public method to clear all spelling markers. |
344 Public method to clear all spelling markers. |
306 </p><a NAME="SpellChecker.getAvailableLanguages" ID="SpellChecker.getAvailableLanguages"></a> |
345 </p><a NAME="SpellChecker.getContext" ID="SpellChecker.getContext"></a> |
307 <h4>SpellChecker.getAvailableLanguages</h4> |
|
308 <b>getAvailableLanguages</b>(<i></i>) |
|
309 <p> |
|
310 Public classmethod to get all available languages. |
|
311 </p><dl> |
|
312 <dt>Returns:</dt> |
|
313 <dd> |
|
314 list of available languages (list of strings) |
|
315 </dd> |
|
316 </dl><a NAME="SpellChecker.getContext" ID="SpellChecker.getContext"></a> |
|
317 <h4>SpellChecker.getContext</h4> |
346 <h4>SpellChecker.getContext</h4> |
318 <b>getContext</b>(<i>wordStart, wordEnd</i>) |
347 <b>getContext</b>(<i>wordStart, wordEnd</i>) |
319 <p> |
348 <p> |
320 Public method to get the context of a faulty word. |
349 Public method to get the context of a faulty word. |
321 </p><dl> |
350 </p><dl> |
394 </dl><dl> |
423 </dl><dl> |
395 <dt>Returns:</dt> |
424 <dt>Returns:</dt> |
396 <dd> |
425 <dd> |
397 flag indicating successful initialization (boolean) |
426 flag indicating successful initialization (boolean) |
398 </dd> |
427 </dd> |
399 </dl><a NAME="SpellChecker.isAvailable" ID="SpellChecker.isAvailable"></a> |
|
400 <h4>SpellChecker.isAvailable</h4> |
|
401 <b>isAvailable</b>(<i></i>) |
|
402 <p> |
|
403 Public classmethod to check, if spellchecking is available. |
|
404 </p><dl> |
|
405 <dt>Returns:</dt> |
|
406 <dd> |
|
407 flag indicating availability (boolean) |
|
408 </dd> |
|
409 </dl><a NAME="SpellChecker.remove" ID="SpellChecker.remove"></a> |
428 </dl><a NAME="SpellChecker.remove" ID="SpellChecker.remove"></a> |
410 <h4>SpellChecker.remove</h4> |
429 <h4>SpellChecker.remove</h4> |
411 <b>remove</b>(<i>word</i>) |
430 <b>remove</b>(<i>word</i>) |
412 <p> |
431 <p> |
413 Public method to add a word to the personal exclude list. |
432 Public method to add a word to the personal exclude list. |
435 with the replacement string. |
454 with the replacement string. |
436 </p><dl> |
455 </p><dl> |
437 <dt><i>replacement</i></dt> |
456 <dt><i>replacement</i></dt> |
438 <dd> |
457 <dd> |
439 replacement string (string) |
458 replacement string (string) |
440 </dd> |
|
441 </dl><a NAME="SpellChecker.setDefaultLanguage" ID="SpellChecker.setDefaultLanguage"></a> |
|
442 <h4>SpellChecker.setDefaultLanguage</h4> |
|
443 <b>setDefaultLanguage</b>(<i>language</i>) |
|
444 <p> |
|
445 Public classmethod to set the default language. |
|
446 </p><dl> |
|
447 <dt><i>language</i></dt> |
|
448 <dd> |
|
449 the language to be used as the default (string). |
|
450 The string should be in language locale format (e.g. en_US, de). |
|
451 </dd> |
459 </dd> |
452 </dl><a NAME="SpellChecker.setLanguage" ID="SpellChecker.setLanguage"></a> |
460 </dl><a NAME="SpellChecker.setLanguage" ID="SpellChecker.setLanguage"></a> |
453 <h4>SpellChecker.setLanguage</h4> |
461 <h4>SpellChecker.setLanguage</h4> |
454 <b>setLanguage</b>(<i>language, pwl = "", pel = ""</i>) |
462 <b>setLanguage</b>(<i>language, pwl = "", pel = ""</i>) |
455 <p> |
463 <p> |