eric6/Documentation/Source/eric6.QScintilla.SpellChecker.html

branch
maintenance
changeset 7286
7eb04391adf7
parent 7273
391d6b7b1eff
child 7900
72b88fb20261
equal deleted inserted replaced
7226:babe80d84a3e 7286:7eb04391adf7
16 16
17 a { color: #BA6D36; } 17 a { color: #BA6D36; }
18 18
19 </style> 19 </style>
20 </head> 20 </head>
21 <body><a NAME="top" ID="top"></a> 21 <body>
22 <a NAME="top" ID="top"></a>
22 <h1>eric6.QScintilla.SpellChecker</h1> 23 <h1>eric6.QScintilla.SpellChecker</h1>
24
23 <p> 25 <p>
24 Module implementing the spell checker for the editor component. 26 Module implementing the spell checker for the editor component.
25 </p><p> 27 </p>
28 <p>
26 The spell checker is based on pyenchant. 29 The spell checker is based on pyenchant.
27 </p> 30 </p>
28 <h3>Global Attributes</h3> 31 <h3>Global Attributes</h3>
32
29 <table> 33 <table>
30 <tr><td>None</td></tr> 34 <tr><td>None</td></tr>
31 </table> 35 </table>
32 <h3>Classes</h3> 36 <h3>Classes</h3>
37
33 <table> 38 <table>
39
34 <tr> 40 <tr>
35 <td><a href="#SpellChecker">SpellChecker</a></td> 41 <td><a href="#SpellChecker">SpellChecker</a></td>
36 <td>Class implementing a pyenchant based spell checker.</td> 42 <td>Class implementing a pyenchant based spell checker.</td>
37 </tr> 43 </tr>
38 </table> 44 </table>
39 <h3>Functions</h3> 45 <h3>Functions</h3>
46
40 <table> 47 <table>
41 <tr><td>None</td></tr> 48 <tr><td>None</td></tr>
42 </table> 49 </table>
43 <hr /><hr /> 50 <hr />
51 <hr />
44 <a NAME="SpellChecker" ID="SpellChecker"></a> 52 <a NAME="SpellChecker" ID="SpellChecker"></a>
45 <h2>SpellChecker</h2> 53 <h2>SpellChecker</h2>
54
46 <p> 55 <p>
47 Class implementing a pyenchant based spell checker. 56 Class implementing a pyenchant based spell checker.
48 </p> 57 </p>
49 <h3>Derived from</h3> 58 <h3>Derived from</h3>
50 QObject 59 QObject
51 <h3>Class Attributes</h3> 60 <h3>Class Attributes</h3>
61
52 <table> 62 <table>
53 <tr><td>_spelling_dict</td></tr><tr><td>_spelling_lang</td></tr> 63 <tr><td>_spelling_dict</td></tr><tr><td>_spelling_lang</td></tr>
54 </table> 64 </table>
55 <h3>Class Methods</h3> 65 <h3>Class Methods</h3>
66
56 <table> 67 <table>
68
57 <tr> 69 <tr>
58 <td><a href="#SpellChecker._getDict">_getDict</a></td> 70 <td><a href="#SpellChecker._getDict">_getDict</a></td>
59 <td>Protected class method to get a new dictionary.</td> 71 <td>Protected class method to get a new dictionary.</td>
60 </tr><tr> 72 </tr>
73 <tr>
61 <td><a href="#SpellChecker.getAvailableLanguages">getAvailableLanguages</a></td> 74 <td><a href="#SpellChecker.getAvailableLanguages">getAvailableLanguages</a></td>
62 <td>Class method to get all available languages.</td> 75 <td>Class method to get all available languages.</td>
63 </tr><tr> 76 </tr>
77 <tr>
64 <td><a href="#SpellChecker.getDefaultPath">getDefaultPath</a></td> 78 <td><a href="#SpellChecker.getDefaultPath">getDefaultPath</a></td>
65 <td>Class method to get the default path names of the user dictionaries.</td> 79 <td>Class method to get the default path names of the user dictionaries.</td>
66 </tr><tr> 80 </tr>
81 <tr>
67 <td><a href="#SpellChecker.getUserDictionaryPath">getUserDictionaryPath</a></td> 82 <td><a href="#SpellChecker.getUserDictionaryPath">getUserDictionaryPath</a></td>
68 <td>Class method to get the path name of a user dictionary file.</td> 83 <td>Class method to get the path name of a user dictionary file.</td>
69 </tr><tr> 84 </tr>
85 <tr>
70 <td><a href="#SpellChecker.isAvailable">isAvailable</a></td> 86 <td><a href="#SpellChecker.isAvailable">isAvailable</a></td>
71 <td>Class method to check, if spellchecking is available.</td> 87 <td>Class method to check, if spellchecking is available.</td>
72 </tr><tr> 88 </tr>
89 <tr>
73 <td><a href="#SpellChecker.setDefaultLanguage">setDefaultLanguage</a></td> 90 <td><a href="#SpellChecker.setDefaultLanguage">setDefaultLanguage</a></td>
74 <td>Class method to set the default language.</td> 91 <td>Class method to set the default language.</td>
75 </tr> 92 </tr>
76 </table> 93 </table>
77 <h3>Methods</h3> 94 <h3>Methods</h3>
95
78 <table> 96 <table>
97
79 <tr> 98 <tr>
80 <td><a href="#SpellChecker.__init__">SpellChecker</a></td> 99 <td><a href="#SpellChecker.__init__">SpellChecker</a></td>
81 <td>Constructor</td> 100 <td>Constructor</td>
82 </tr><tr> 101 </tr>
102 <tr>
83 <td><a href="#SpellChecker.__checkDocumentPart">__checkDocumentPart</a></td> 103 <td><a href="#SpellChecker.__checkDocumentPart">__checkDocumentPart</a></td>
84 <td>Private method to check some part of the document.</td> 104 <td>Private method to check some part of the document.</td>
85 </tr><tr> 105 </tr>
106 <tr>
86 <td><a href="#SpellChecker.__getNextWord">__getNextWord</a></td> 107 <td><a href="#SpellChecker.__getNextWord">__getNextWord</a></td>
87 <td>Private method to get the next word in the text after the given position.</td> 108 <td>Private method to get the next word in the text after the given position.</td>
88 </tr><tr> 109 </tr>
110 <tr>
89 <td><a href="#SpellChecker.__incrementalCheck">__incrementalCheck</a></td> 111 <td><a href="#SpellChecker.__incrementalCheck">__incrementalCheck</a></td>
90 <td>Private method to check the document incrementally.</td> 112 <td>Private method to check the document incrementally.</td>
91 </tr><tr> 113 </tr>
114 <tr>
92 <td><a href="#SpellChecker.__iter__">__iter__</a></td> 115 <td><a href="#SpellChecker.__iter__">__iter__</a></td>
93 <td>Special method to create an iterator.</td> 116 <td>Special method to create an iterator.</td>
94 </tr><tr> 117 </tr>
118 <tr>
95 <td><a href="#SpellChecker.__next__">__next__</a></td> 119 <td><a href="#SpellChecker.__next__">__next__</a></td>
96 <td>Special method to advance to the next error.</td> 120 <td>Special method to advance to the next error.</td>
97 </tr><tr> 121 </tr>
122 <tr>
98 <td><a href="#SpellChecker.add">add</a></td> 123 <td><a href="#SpellChecker.add">add</a></td>
99 <td>Public method to add a word to the personal word list.</td> 124 <td>Public method to add a word to the personal word list.</td>
100 </tr><tr> 125 </tr>
126 <tr>
101 <td><a href="#SpellChecker.checkCurrentPage">checkCurrentPage</a></td> 127 <td><a href="#SpellChecker.checkCurrentPage">checkCurrentPage</a></td>
102 <td>Public method to check the currently visible page.</td> 128 <td>Public method to check the currently visible page.</td>
103 </tr><tr> 129 </tr>
130 <tr>
104 <td><a href="#SpellChecker.checkDocument">checkDocument</a></td> 131 <td><a href="#SpellChecker.checkDocument">checkDocument</a></td>
105 <td>Public method to check the complete document.</td> 132 <td>Public method to check the complete document.</td>
106 </tr><tr> 133 </tr>
134 <tr>
107 <td><a href="#SpellChecker.checkDocumentIncrementally">checkDocumentIncrementally</a></td> 135 <td><a href="#SpellChecker.checkDocumentIncrementally">checkDocumentIncrementally</a></td>
108 <td>Public method to check the document incrementally.</td> 136 <td>Public method to check the document incrementally.</td>
109 </tr><tr> 137 </tr>
138 <tr>
110 <td><a href="#SpellChecker.checkLines">checkLines</a></td> 139 <td><a href="#SpellChecker.checkLines">checkLines</a></td>
111 <td>Public method to check some lines of text.</td> 140 <td>Public method to check some lines of text.</td>
112 </tr><tr> 141 </tr>
142 <tr>
113 <td><a href="#SpellChecker.checkSelection">checkSelection</a></td> 143 <td><a href="#SpellChecker.checkSelection">checkSelection</a></td>
114 <td>Public method to check the current selection.</td> 144 <td>Public method to check the current selection.</td>
115 </tr><tr> 145 </tr>
146 <tr>
116 <td><a href="#SpellChecker.checkWord">checkWord</a></td> 147 <td><a href="#SpellChecker.checkWord">checkWord</a></td>
117 <td>Public method to check the word at position pos.</td> 148 <td>Public method to check the word at position pos.</td>
118 </tr><tr> 149 </tr>
150 <tr>
119 <td><a href="#SpellChecker.clearAll">clearAll</a></td> 151 <td><a href="#SpellChecker.clearAll">clearAll</a></td>
120 <td>Public method to clear all spelling markers.</td> 152 <td>Public method to clear all spelling markers.</td>
121 </tr><tr> 153 </tr>
154 <tr>
122 <td><a href="#SpellChecker.getContext">getContext</a></td> 155 <td><a href="#SpellChecker.getContext">getContext</a></td>
123 <td>Public method to get the context of a faulty word.</td> 156 <td>Public method to get the context of a faulty word.</td>
124 </tr><tr> 157 </tr>
158 <tr>
125 <td><a href="#SpellChecker.getError">getError</a></td> 159 <td><a href="#SpellChecker.getError">getError</a></td>
126 <td>Public method to get information about the last error found.</td> 160 <td>Public method to get information about the last error found.</td>
127 </tr><tr> 161 </tr>
162 <tr>
128 <td><a href="#SpellChecker.getLanguage">getLanguage</a></td> 163 <td><a href="#SpellChecker.getLanguage">getLanguage</a></td>
129 <td>Public method to get the current language.</td> 164 <td>Public method to get the current language.</td>
130 </tr><tr> 165 </tr>
166 <tr>
131 <td><a href="#SpellChecker.getSuggestions">getSuggestions</a></td> 167 <td><a href="#SpellChecker.getSuggestions">getSuggestions</a></td>
132 <td>Public method to get suggestions for the given word.</td> 168 <td>Public method to get suggestions for the given word.</td>
133 </tr><tr> 169 </tr>
170 <tr>
134 <td><a href="#SpellChecker.ignoreAlways">ignoreAlways</a></td> 171 <td><a href="#SpellChecker.ignoreAlways">ignoreAlways</a></td>
135 <td>Public method to tell the checker, to always ignore the given word or the current word.</td> 172 <td>Public method to tell the checker, to always ignore the given word or the current word.</td>
136 </tr><tr> 173 </tr>
174 <tr>
137 <td><a href="#SpellChecker.initCheck">initCheck</a></td> 175 <td><a href="#SpellChecker.initCheck">initCheck</a></td>
138 <td>Public method to initialize a spell check.</td> 176 <td>Public method to initialize a spell check.</td>
139 </tr><tr> 177 </tr>
140 <td><a href="#SpellChecker.next">next</a></td> 178 <tr>
141 <td>Public method to advance to the next error.</td>
142 </tr><tr>
143 <td><a href="#SpellChecker.remove">remove</a></td> 179 <td><a href="#SpellChecker.remove">remove</a></td>
144 <td>Public method to add a word to the personal exclude list.</td> 180 <td>Public method to add a word to the personal exclude list.</td>
145 </tr><tr> 181 </tr>
182 <tr>
146 <td><a href="#SpellChecker.replace">replace</a></td> 183 <td><a href="#SpellChecker.replace">replace</a></td>
147 <td>Public method to tell the checker to replace the current word with the replacement string.</td> 184 <td>Public method to tell the checker to replace the current word with the replacement string.</td>
148 </tr><tr> 185 </tr>
186 <tr>
149 <td><a href="#SpellChecker.replaceAlways">replaceAlways</a></td> 187 <td><a href="#SpellChecker.replaceAlways">replaceAlways</a></td>
150 <td>Public method to tell the checker to always replace the current word with the replacement string.</td> 188 <td>Public method to tell the checker to always replace the current word with the replacement string.</td>
151 </tr><tr> 189 </tr>
190 <tr>
152 <td><a href="#SpellChecker.setLanguage">setLanguage</a></td> 191 <td><a href="#SpellChecker.setLanguage">setLanguage</a></td>
153 <td>Public method to set the current language.</td> 192 <td>Public method to set the current language.</td>
154 </tr><tr> 193 </tr>
194 <tr>
155 <td><a href="#SpellChecker.setMinimumWordSize">setMinimumWordSize</a></td> 195 <td><a href="#SpellChecker.setMinimumWordSize">setMinimumWordSize</a></td>
156 <td>Public method to set the minimum word size.</td> 196 <td>Public method to set the minimum word size.</td>
157 </tr><tr> 197 </tr>
198 <tr>
158 <td><a href="#SpellChecker.stopIncrementalCheck">stopIncrementalCheck</a></td> 199 <td><a href="#SpellChecker.stopIncrementalCheck">stopIncrementalCheck</a></td>
159 <td>Public method to stop an incremental check.</td> 200 <td>Public method to stop an incremental check.</td>
160 </tr> 201 </tr>
161 </table> 202 </table>
162 <h3>Static Methods</h3> 203 <h3>Static Methods</h3>
204
163 <table> 205 <table>
164 <tr><td>None</td></tr> 206 <tr><td>None</td></tr>
165 </table> 207 </table>
208
166 <a NAME="SpellChecker._getDict" ID="SpellChecker._getDict"></a> 209 <a NAME="SpellChecker._getDict" ID="SpellChecker._getDict"></a>
167 <h4>SpellChecker._getDict (class method)</h4> 210 <h4>SpellChecker._getDict (class method)</h4>
168 <b>_getDict</b>(<i>lang, pwl="", pel=""</i>) 211 <b>_getDict</b>(<i>lang, pwl="", pel=""</i>)
212
169 <p> 213 <p>
170 Protected class method to get a new dictionary. 214 Protected class method to get a new dictionary.
171 </p><dl> 215 </p>
216 <dl>
217
172 <dt><i>lang</i></dt> 218 <dt><i>lang</i></dt>
173 <dd> 219 <dd>
174 the language to be used as the default (string). 220 the language to be used as the default (string).
175 The string should be in language locale format (e.g. en_US, de). 221 The string should be in language locale format (e.g. en_US, de).
176 </dd><dt><i>pwl=</i></dt> 222 </dd>
223 <dt><i>pwl=</i></dt>
177 <dd> 224 <dd>
178 name of the personal/project word list (string) 225 name of the personal/project word list (string)
179 </dd><dt><i>pel=</i></dt> 226 </dd>
227 <dt><i>pel=</i></dt>
180 <dd> 228 <dd>
181 name of the personal/project exclude list (string) 229 name of the personal/project exclude list (string)
182 </dd> 230 </dd>
183 </dl><dl> 231 </dl>
232 <dl>
184 <dt>Returns:</dt> 233 <dt>Returns:</dt>
185 <dd> 234 <dd>
186 reference to the dictionary (enchant.Dict) 235 reference to the dictionary (enchant.Dict)
187 </dd> 236 </dd>
188 </dl><a NAME="SpellChecker.getAvailableLanguages" ID="SpellChecker.getAvailableLanguages"></a> 237 </dl>
238 <a NAME="SpellChecker.getAvailableLanguages" ID="SpellChecker.getAvailableLanguages"></a>
189 <h4>SpellChecker.getAvailableLanguages (class method)</h4> 239 <h4>SpellChecker.getAvailableLanguages (class method)</h4>
190 <b>getAvailableLanguages</b>(<i></i>) 240 <b>getAvailableLanguages</b>(<i></i>)
241
191 <p> 242 <p>
192 Class method to get all available languages. 243 Class method to get all available languages.
193 </p><dl> 244 </p>
245 <dl>
194 <dt>Returns:</dt> 246 <dt>Returns:</dt>
195 <dd> 247 <dd>
196 list of available languages (list of strings) 248 list of available languages (list of strings)
197 </dd> 249 </dd>
198 </dl><a NAME="SpellChecker.getDefaultPath" ID="SpellChecker.getDefaultPath"></a> 250 </dl>
251 <a NAME="SpellChecker.getDefaultPath" ID="SpellChecker.getDefaultPath"></a>
199 <h4>SpellChecker.getDefaultPath (class method)</h4> 252 <h4>SpellChecker.getDefaultPath (class method)</h4>
200 <b>getDefaultPath</b>(<i>isException=False</i>) 253 <b>getDefaultPath</b>(<i>isException=False</i>)
254
201 <p> 255 <p>
202 Class method to get the default path names of the user dictionaries. 256 Class method to get the default path names of the user dictionaries.
203 </p><dl> 257 </p>
258 <dl>
259
204 <dt><i>isException</i></dt> 260 <dt><i>isException</i></dt>
205 <dd> 261 <dd>
206 flag indicating to return the name of the default 262 flag indicating to return the name of the default
207 exception dictionary (boolean) 263 exception dictionary (boolean)
208 </dd> 264 </dd>
209 </dl><dl> 265 </dl>
266 <dl>
210 <dt>Returns:</dt> 267 <dt>Returns:</dt>
211 <dd> 268 <dd>
212 file name of the default user dictionary or the default user 269 file name of the default user dictionary or the default user
213 exception dictionary (string) 270 exception dictionary (string)
214 </dd> 271 </dd>
215 </dl><a NAME="SpellChecker.getUserDictionaryPath" ID="SpellChecker.getUserDictionaryPath"></a> 272 </dl>
273 <a NAME="SpellChecker.getUserDictionaryPath" ID="SpellChecker.getUserDictionaryPath"></a>
216 <h4>SpellChecker.getUserDictionaryPath (class method)</h4> 274 <h4>SpellChecker.getUserDictionaryPath (class method)</h4>
217 <b>getUserDictionaryPath</b>(<i>isException=False</i>) 275 <b>getUserDictionaryPath</b>(<i>isException=False</i>)
276
218 <p> 277 <p>
219 Class method to get the path name of a user dictionary file. 278 Class method to get the path name of a user dictionary file.
220 </p><dl> 279 </p>
280 <dl>
281
221 <dt><i>isException</i></dt> 282 <dt><i>isException</i></dt>
222 <dd> 283 <dd>
223 flag indicating to return the name of the user 284 flag indicating to return the name of the user
224 exception dictionary (boolean) 285 exception dictionary (boolean)
225 </dd> 286 </dd>
226 </dl><dl> 287 </dl>
288 <dl>
227 <dt>Returns:</dt> 289 <dt>Returns:</dt>
228 <dd> 290 <dd>
229 file name of the user dictionary or the user exception 291 file name of the user dictionary or the user exception
230 dictionary (string) 292 dictionary (string)
231 </dd> 293 </dd>
232 </dl><a NAME="SpellChecker.isAvailable" ID="SpellChecker.isAvailable"></a> 294 </dl>
295 <a NAME="SpellChecker.isAvailable" ID="SpellChecker.isAvailable"></a>
233 <h4>SpellChecker.isAvailable (class method)</h4> 296 <h4>SpellChecker.isAvailable (class method)</h4>
234 <b>isAvailable</b>(<i></i>) 297 <b>isAvailable</b>(<i></i>)
298
235 <p> 299 <p>
236 Class method to check, if spellchecking is available. 300 Class method to check, if spellchecking is available.
237 </p><dl> 301 </p>
302 <dl>
238 <dt>Returns:</dt> 303 <dt>Returns:</dt>
239 <dd> 304 <dd>
240 flag indicating availability (boolean) 305 flag indicating availability (boolean)
241 </dd> 306 </dd>
242 </dl><a NAME="SpellChecker.setDefaultLanguage" ID="SpellChecker.setDefaultLanguage"></a> 307 </dl>
308 <a NAME="SpellChecker.setDefaultLanguage" ID="SpellChecker.setDefaultLanguage"></a>
243 <h4>SpellChecker.setDefaultLanguage (class method)</h4> 309 <h4>SpellChecker.setDefaultLanguage (class method)</h4>
244 <b>setDefaultLanguage</b>(<i>language</i>) 310 <b>setDefaultLanguage</b>(<i>language</i>)
311
245 <p> 312 <p>
246 Class method to set the default language. 313 Class method to set the default language.
247 </p><dl> 314 </p>
315 <dl>
316
248 <dt><i>language</i></dt> 317 <dt><i>language</i></dt>
249 <dd> 318 <dd>
250 the language to be used as the default (string). 319 the language to be used as the default (string).
251 The string should be in language locale format (e.g. en_US, de). 320 The string should be in language locale format (e.g. en_US, de).
252 </dd> 321 </dd>
253 </dl><a NAME="SpellChecker.__init__" ID="SpellChecker.__init__"></a> 322 </dl>
323 <a NAME="SpellChecker.__init__" ID="SpellChecker.__init__"></a>
254 <h4>SpellChecker (Constructor)</h4> 324 <h4>SpellChecker (Constructor)</h4>
255 <b>SpellChecker</b>(<i>editor, indicator, defaultLanguage=None, checkRegion=None</i>) 325 <b>SpellChecker</b>(<i>editor, indicator, defaultLanguage=None, checkRegion=None</i>)
326
256 <p> 327 <p>
257 Constructor 328 Constructor
258 </p><dl> 329 </p>
330 <dl>
331
259 <dt><i>editor</i></dt> 332 <dt><i>editor</i></dt>
260 <dd> 333 <dd>
261 reference to the editor object (QScintilla.Editor) 334 reference to the editor object (QScintilla.Editor)
262 </dd><dt><i>indicator</i></dt> 335 </dd>
336 <dt><i>indicator</i></dt>
263 <dd> 337 <dd>
264 spell checking indicator 338 spell checking indicator
265 </dd><dt><i>defaultLanguage=</i></dt> 339 </dd>
340 <dt><i>defaultLanguage=</i></dt>
266 <dd> 341 <dd>
267 the language to be used as the default 342 the language to be used as the default
268 (string). The string should be in language locale format 343 (string). The string should be in language locale format
269 (e.g. en_US, de). 344 (e.g. en_US, de).
270 </dd><dt><i>checkRegion=</i></dt> 345 </dd>
346 <dt><i>checkRegion=</i></dt>
271 <dd> 347 <dd>
272 reference to a function to check for a valid 348 reference to a function to check for a valid
273 region 349 region
274 </dd> 350 </dd>
275 </dl><a NAME="SpellChecker.__checkDocumentPart" ID="SpellChecker.__checkDocumentPart"></a> 351 </dl>
352 <a NAME="SpellChecker.__checkDocumentPart" ID="SpellChecker.__checkDocumentPart"></a>
276 <h4>SpellChecker.__checkDocumentPart</h4> 353 <h4>SpellChecker.__checkDocumentPart</h4>
277 <b>__checkDocumentPart</b>(<i>startPos, endPos</i>) 354 <b>__checkDocumentPart</b>(<i>startPos, endPos</i>)
355
278 <p> 356 <p>
279 Private method to check some part of the document. 357 Private method to check some part of the document.
280 </p><dl> 358 </p>
359 <dl>
360
281 <dt><i>startPos</i></dt> 361 <dt><i>startPos</i></dt>
282 <dd> 362 <dd>
283 position to start at (integer) 363 position to start at (integer)
284 </dd><dt><i>endPos</i></dt> 364 </dd>
365 <dt><i>endPos</i></dt>
285 <dd> 366 <dd>
286 position to end at (integer) 367 position to end at (integer)
287 </dd> 368 </dd>
288 </dl><a NAME="SpellChecker.__getNextWord" ID="SpellChecker.__getNextWord"></a> 369 </dl>
370 <a NAME="SpellChecker.__getNextWord" ID="SpellChecker.__getNextWord"></a>
289 <h4>SpellChecker.__getNextWord</h4> 371 <h4>SpellChecker.__getNextWord</h4>
290 <b>__getNextWord</b>(<i>pos, endPosition</i>) 372 <b>__getNextWord</b>(<i>pos, endPosition</i>)
373
291 <p> 374 <p>
292 Private method to get the next word in the text after the given 375 Private method to get the next word in the text after the given
293 position. 376 position.
294 </p><dl> 377 </p>
378 <dl>
379
295 <dt><i>pos</i></dt> 380 <dt><i>pos</i></dt>
296 <dd> 381 <dd>
297 position to start word extraction (integer) 382 position to start word extraction (integer)
298 </dd><dt><i>endPosition</i></dt> 383 </dd>
384 <dt><i>endPosition</i></dt>
299 <dd> 385 <dd>
300 position to stop word extraction (integer) 386 position to stop word extraction (integer)
301 </dd> 387 </dd>
302 </dl><dl> 388 </dl>
389 <dl>
303 <dt>Returns:</dt> 390 <dt>Returns:</dt>
304 <dd> 391 <dd>
305 tuple of three values (the extracted word (string), 392 tuple of three values (the extracted word (string),
306 start position (integer), end position (integer)) 393 start position (integer), end position (integer))
307 </dd> 394 </dd>
308 </dl><a NAME="SpellChecker.__incrementalCheck" ID="SpellChecker.__incrementalCheck"></a> 395 </dl>
396 <a NAME="SpellChecker.__incrementalCheck" ID="SpellChecker.__incrementalCheck"></a>
309 <h4>SpellChecker.__incrementalCheck</h4> 397 <h4>SpellChecker.__incrementalCheck</h4>
310 <b>__incrementalCheck</b>(<i></i>) 398 <b>__incrementalCheck</b>(<i></i>)
399
311 <p> 400 <p>
312 Private method to check the document incrementally. 401 Private method to check the document incrementally.
313 </p><a NAME="SpellChecker.__iter__" ID="SpellChecker.__iter__"></a> 402 </p>
403 <a NAME="SpellChecker.__iter__" ID="SpellChecker.__iter__"></a>
314 <h4>SpellChecker.__iter__</h4> 404 <h4>SpellChecker.__iter__</h4>
315 <b>__iter__</b>(<i></i>) 405 <b>__iter__</b>(<i></i>)
406
316 <p> 407 <p>
317 Special method to create an iterator. 408 Special method to create an iterator.
318 </p><dl> 409 </p>
410 <dl>
319 <dt>Returns:</dt> 411 <dt>Returns:</dt>
320 <dd> 412 <dd>
321 self 413 self
322 </dd> 414 </dd>
323 </dl><a NAME="SpellChecker.__next__" ID="SpellChecker.__next__"></a> 415 </dl>
416 <a NAME="SpellChecker.__next__" ID="SpellChecker.__next__"></a>
324 <h4>SpellChecker.__next__</h4> 417 <h4>SpellChecker.__next__</h4>
325 <b>__next__</b>(<i></i>) 418 <b>__next__</b>(<i></i>)
419
326 <p> 420 <p>
327 Special method to advance to the next error. 421 Special method to advance to the next error.
328 </p><dl> 422 </p>
423 <dl>
329 <dt>Returns:</dt> 424 <dt>Returns:</dt>
330 <dd> 425 <dd>
331 self 426 self
332 </dd> 427 </dd>
333 </dl><dl> 428 </dl>
429 <dl>
430
334 <dt>Raises <b>StopIteration</b>:</dt> 431 <dt>Raises <b>StopIteration</b>:</dt>
335 <dd> 432 <dd>
336 raised to indicate the end of the iteration 433 raised to indicate the end of the iteration
337 </dd> 434 </dd>
338 </dl><a NAME="SpellChecker.add" ID="SpellChecker.add"></a> 435 </dl>
436 <a NAME="SpellChecker.add" ID="SpellChecker.add"></a>
339 <h4>SpellChecker.add</h4> 437 <h4>SpellChecker.add</h4>
340 <b>add</b>(<i>word=None</i>) 438 <b>add</b>(<i>word=None</i>)
439
341 <p> 440 <p>
342 Public method to add a word to the personal word list. 441 Public method to add a word to the personal word list.
343 </p><dl> 442 </p>
443 <dl>
444
344 <dt><i>word</i></dt> 445 <dt><i>word</i></dt>
345 <dd> 446 <dd>
346 word to add (string) 447 word to add (string)
347 </dd> 448 </dd>
348 </dl><a NAME="SpellChecker.checkCurrentPage" ID="SpellChecker.checkCurrentPage"></a> 449 </dl>
450 <a NAME="SpellChecker.checkCurrentPage" ID="SpellChecker.checkCurrentPage"></a>
349 <h4>SpellChecker.checkCurrentPage</h4> 451 <h4>SpellChecker.checkCurrentPage</h4>
350 <b>checkCurrentPage</b>(<i></i>) 452 <b>checkCurrentPage</b>(<i></i>)
453
351 <p> 454 <p>
352 Public method to check the currently visible page. 455 Public method to check the currently visible page.
353 </p><a NAME="SpellChecker.checkDocument" ID="SpellChecker.checkDocument"></a> 456 </p>
457 <a NAME="SpellChecker.checkDocument" ID="SpellChecker.checkDocument"></a>
354 <h4>SpellChecker.checkDocument</h4> 458 <h4>SpellChecker.checkDocument</h4>
355 <b>checkDocument</b>(<i></i>) 459 <b>checkDocument</b>(<i></i>)
460
356 <p> 461 <p>
357 Public method to check the complete document. 462 Public method to check the complete document.
358 </p><a NAME="SpellChecker.checkDocumentIncrementally" ID="SpellChecker.checkDocumentIncrementally"></a> 463 </p>
464 <a NAME="SpellChecker.checkDocumentIncrementally" ID="SpellChecker.checkDocumentIncrementally"></a>
359 <h4>SpellChecker.checkDocumentIncrementally</h4> 465 <h4>SpellChecker.checkDocumentIncrementally</h4>
360 <b>checkDocumentIncrementally</b>(<i></i>) 466 <b>checkDocumentIncrementally</b>(<i></i>)
467
361 <p> 468 <p>
362 Public method to check the document incrementally. 469 Public method to check the document incrementally.
363 </p><a NAME="SpellChecker.checkLines" ID="SpellChecker.checkLines"></a> 470 </p>
471 <a NAME="SpellChecker.checkLines" ID="SpellChecker.checkLines"></a>
364 <h4>SpellChecker.checkLines</h4> 472 <h4>SpellChecker.checkLines</h4>
365 <b>checkLines</b>(<i>firstLine, lastLine</i>) 473 <b>checkLines</b>(<i>firstLine, lastLine</i>)
474
366 <p> 475 <p>
367 Public method to check some lines of text. 476 Public method to check some lines of text.
368 </p><dl> 477 </p>
478 <dl>
479
369 <dt><i>firstLine</i></dt> 480 <dt><i>firstLine</i></dt>
370 <dd> 481 <dd>
371 line number of first line to check (integer) 482 line number of first line to check (integer)
372 </dd><dt><i>lastLine</i></dt> 483 </dd>
484 <dt><i>lastLine</i></dt>
373 <dd> 485 <dd>
374 line number of last line to check (integer) 486 line number of last line to check (integer)
375 </dd> 487 </dd>
376 </dl><a NAME="SpellChecker.checkSelection" ID="SpellChecker.checkSelection"></a> 488 </dl>
489 <a NAME="SpellChecker.checkSelection" ID="SpellChecker.checkSelection"></a>
377 <h4>SpellChecker.checkSelection</h4> 490 <h4>SpellChecker.checkSelection</h4>
378 <b>checkSelection</b>(<i></i>) 491 <b>checkSelection</b>(<i></i>)
492
379 <p> 493 <p>
380 Public method to check the current selection. 494 Public method to check the current selection.
381 </p><a NAME="SpellChecker.checkWord" ID="SpellChecker.checkWord"></a> 495 </p>
496 <a NAME="SpellChecker.checkWord" ID="SpellChecker.checkWord"></a>
382 <h4>SpellChecker.checkWord</h4> 497 <h4>SpellChecker.checkWord</h4>
383 <b>checkWord</b>(<i>pos, atEnd=False</i>) 498 <b>checkWord</b>(<i>pos, atEnd=False</i>)
499
384 <p> 500 <p>
385 Public method to check the word at position pos. 501 Public method to check the word at position pos.
386 </p><dl> 502 </p>
503 <dl>
504
387 <dt><i>pos</i></dt> 505 <dt><i>pos</i></dt>
388 <dd> 506 <dd>
389 position to check at (integer) 507 position to check at (integer)
390 </dd><dt><i>atEnd=</i></dt> 508 </dd>
509 <dt><i>atEnd=</i></dt>
391 <dd> 510 <dd>
392 flag indicating the position is at the end of the word 511 flag indicating the position is at the end of the word
393 to check (boolean) 512 to check (boolean)
394 </dd> 513 </dd>
395 </dl><a NAME="SpellChecker.clearAll" ID="SpellChecker.clearAll"></a> 514 </dl>
515 <a NAME="SpellChecker.clearAll" ID="SpellChecker.clearAll"></a>
396 <h4>SpellChecker.clearAll</h4> 516 <h4>SpellChecker.clearAll</h4>
397 <b>clearAll</b>(<i></i>) 517 <b>clearAll</b>(<i></i>)
518
398 <p> 519 <p>
399 Public method to clear all spelling markers. 520 Public method to clear all spelling markers.
400 </p><a NAME="SpellChecker.getContext" ID="SpellChecker.getContext"></a> 521 </p>
522 <a NAME="SpellChecker.getContext" ID="SpellChecker.getContext"></a>
401 <h4>SpellChecker.getContext</h4> 523 <h4>SpellChecker.getContext</h4>
402 <b>getContext</b>(<i>wordStart, wordEnd</i>) 524 <b>getContext</b>(<i>wordStart, wordEnd</i>)
525
403 <p> 526 <p>
404 Public method to get the context of a faulty word. 527 Public method to get the context of a faulty word.
405 </p><dl> 528 </p>
529 <dl>
530
406 <dt><i>wordStart</i></dt> 531 <dt><i>wordStart</i></dt>
407 <dd> 532 <dd>
408 the starting position of the word (integer) 533 the starting position of the word (integer)
409 </dd><dt><i>wordEnd</i></dt> 534 </dd>
535 <dt><i>wordEnd</i></dt>
410 <dd> 536 <dd>
411 the ending position of the word (integer) 537 the ending position of the word (integer)
412 </dd> 538 </dd>
413 </dl><dl> 539 </dl>
540 <dl>
414 <dt>Returns:</dt> 541 <dt>Returns:</dt>
415 <dd> 542 <dd>
416 tuple of the leading and trailing context (string, string) 543 tuple of the leading and trailing context (string, string)
417 </dd> 544 </dd>
418 </dl><a NAME="SpellChecker.getError" ID="SpellChecker.getError"></a> 545 </dl>
546 <a NAME="SpellChecker.getError" ID="SpellChecker.getError"></a>
419 <h4>SpellChecker.getError</h4> 547 <h4>SpellChecker.getError</h4>
420 <b>getError</b>(<i></i>) 548 <b>getError</b>(<i></i>)
549
421 <p> 550 <p>
422 Public method to get information about the last error found. 551 Public method to get information about the last error found.
423 </p><dl> 552 </p>
553 <dl>
424 <dt>Returns:</dt> 554 <dt>Returns:</dt>
425 <dd> 555 <dd>
426 tuple of last faulty word (string), starting position of the 556 tuple of last faulty word (string), starting position of the
427 faulty word (integer) and ending position of the faulty word 557 faulty word (integer) and ending position of the faulty word
428 (integer) 558 (integer)
429 </dd> 559 </dd>
430 </dl><a NAME="SpellChecker.getLanguage" ID="SpellChecker.getLanguage"></a> 560 </dl>
561 <a NAME="SpellChecker.getLanguage" ID="SpellChecker.getLanguage"></a>
431 <h4>SpellChecker.getLanguage</h4> 562 <h4>SpellChecker.getLanguage</h4>
432 <b>getLanguage</b>(<i></i>) 563 <b>getLanguage</b>(<i></i>)
564
433 <p> 565 <p>
434 Public method to get the current language. 566 Public method to get the current language.
435 </p><dl> 567 </p>
568 <dl>
436 <dt>Returns:</dt> 569 <dt>Returns:</dt>
437 <dd> 570 <dd>
438 current language in language locale format (string) 571 current language in language locale format (string)
439 </dd> 572 </dd>
440 </dl><a NAME="SpellChecker.getSuggestions" ID="SpellChecker.getSuggestions"></a> 573 </dl>
574 <a NAME="SpellChecker.getSuggestions" ID="SpellChecker.getSuggestions"></a>
441 <h4>SpellChecker.getSuggestions</h4> 575 <h4>SpellChecker.getSuggestions</h4>
442 <b>getSuggestions</b>(<i>word</i>) 576 <b>getSuggestions</b>(<i>word</i>)
577
443 <p> 578 <p>
444 Public method to get suggestions for the given word. 579 Public method to get suggestions for the given word.
445 </p><dl> 580 </p>
581 <dl>
582
446 <dt><i>word</i></dt> 583 <dt><i>word</i></dt>
447 <dd> 584 <dd>
448 word to get suggestions for (string) 585 word to get suggestions for (string)
449 </dd> 586 </dd>
450 </dl><dl> 587 </dl>
588 <dl>
451 <dt>Returns:</dt> 589 <dt>Returns:</dt>
452 <dd> 590 <dd>
453 list of suggestions (list of strings) 591 list of suggestions (list of strings)
454 </dd> 592 </dd>
455 </dl><a NAME="SpellChecker.ignoreAlways" ID="SpellChecker.ignoreAlways"></a> 593 </dl>
594 <a NAME="SpellChecker.ignoreAlways" ID="SpellChecker.ignoreAlways"></a>
456 <h4>SpellChecker.ignoreAlways</h4> 595 <h4>SpellChecker.ignoreAlways</h4>
457 <b>ignoreAlways</b>(<i>word=None</i>) 596 <b>ignoreAlways</b>(<i>word=None</i>)
597
458 <p> 598 <p>
459 Public method to tell the checker, to always ignore the given word 599 Public method to tell the checker, to always ignore the given word
460 or the current word. 600 or the current word.
461 </p><dl> 601 </p>
602 <dl>
603
462 <dt><i>word</i></dt> 604 <dt><i>word</i></dt>
463 <dd> 605 <dd>
464 word to be ignored (string) 606 word to be ignored (string)
465 </dd> 607 </dd>
466 </dl><a NAME="SpellChecker.initCheck" ID="SpellChecker.initCheck"></a> 608 </dl>
609 <a NAME="SpellChecker.initCheck" ID="SpellChecker.initCheck"></a>
467 <h4>SpellChecker.initCheck</h4> 610 <h4>SpellChecker.initCheck</h4>
468 <b>initCheck</b>(<i>startPos, endPos</i>) 611 <b>initCheck</b>(<i>startPos, endPos</i>)
612
469 <p> 613 <p>
470 Public method to initialize a spell check. 614 Public method to initialize a spell check.
471 </p><dl> 615 </p>
616 <dl>
617
472 <dt><i>startPos</i></dt> 618 <dt><i>startPos</i></dt>
473 <dd> 619 <dd>
474 position to start at (integer) 620 position to start at (integer)
475 </dd><dt><i>endPos</i></dt> 621 </dd>
622 <dt><i>endPos</i></dt>
476 <dd> 623 <dd>
477 position to end at (integer) 624 position to end at (integer)
478 </dd> 625 </dd>
479 </dl><dl> 626 </dl>
627 <dl>
480 <dt>Returns:</dt> 628 <dt>Returns:</dt>
481 <dd> 629 <dd>
482 flag indicating successful initialization (boolean) 630 flag indicating successful initialization (boolean)
483 </dd> 631 </dd>
484 </dl><a NAME="SpellChecker.next" ID="SpellChecker.next"></a> 632 </dl>
485 <h4>SpellChecker.next</h4> 633 <a NAME="SpellChecker.remove" ID="SpellChecker.remove"></a>
486 <b>next</b>(<i></i>)
487 <p>
488 Public method to advance to the next error.
489 </p><dl>
490 <dt>Returns:</dt>
491 <dd>
492 self
493 </dd>
494 </dl><a NAME="SpellChecker.remove" ID="SpellChecker.remove"></a>
495 <h4>SpellChecker.remove</h4> 634 <h4>SpellChecker.remove</h4>
496 <b>remove</b>(<i>word</i>) 635 <b>remove</b>(<i>word</i>)
636
497 <p> 637 <p>
498 Public method to add a word to the personal exclude list. 638 Public method to add a word to the personal exclude list.
499 </p><dl> 639 </p>
640 <dl>
641
500 <dt><i>word</i></dt> 642 <dt><i>word</i></dt>
501 <dd> 643 <dd>
502 word to add (string) 644 word to add (string)
503 </dd> 645 </dd>
504 </dl><a NAME="SpellChecker.replace" ID="SpellChecker.replace"></a> 646 </dl>
647 <a NAME="SpellChecker.replace" ID="SpellChecker.replace"></a>
505 <h4>SpellChecker.replace</h4> 648 <h4>SpellChecker.replace</h4>
506 <b>replace</b>(<i>replacement</i>) 649 <b>replace</b>(<i>replacement</i>)
650
507 <p> 651 <p>
508 Public method to tell the checker to replace the current word with 652 Public method to tell the checker to replace the current word with
509 the replacement string. 653 the replacement string.
510 </p><dl> 654 </p>
655 <dl>
656
511 <dt><i>replacement</i></dt> 657 <dt><i>replacement</i></dt>
512 <dd> 658 <dd>
513 replacement string (string) 659 replacement string (string)
514 </dd> 660 </dd>
515 </dl><a NAME="SpellChecker.replaceAlways" ID="SpellChecker.replaceAlways"></a> 661 </dl>
662 <a NAME="SpellChecker.replaceAlways" ID="SpellChecker.replaceAlways"></a>
516 <h4>SpellChecker.replaceAlways</h4> 663 <h4>SpellChecker.replaceAlways</h4>
517 <b>replaceAlways</b>(<i>replacement</i>) 664 <b>replaceAlways</b>(<i>replacement</i>)
665
518 <p> 666 <p>
519 Public method to tell the checker to always replace the current word 667 Public method to tell the checker to always replace the current word
520 with the replacement string. 668 with the replacement string.
521 </p><dl> 669 </p>
670 <dl>
671
522 <dt><i>replacement</i></dt> 672 <dt><i>replacement</i></dt>
523 <dd> 673 <dd>
524 replacement string (string) 674 replacement string (string)
525 </dd> 675 </dd>
526 </dl><a NAME="SpellChecker.setLanguage" ID="SpellChecker.setLanguage"></a> 676 </dl>
677 <a NAME="SpellChecker.setLanguage" ID="SpellChecker.setLanguage"></a>
527 <h4>SpellChecker.setLanguage</h4> 678 <h4>SpellChecker.setLanguage</h4>
528 <b>setLanguage</b>(<i>language, pwl="", pel=""</i>) 679 <b>setLanguage</b>(<i>language, pwl="", pel=""</i>)
680
529 <p> 681 <p>
530 Public method to set the current language. 682 Public method to set the current language.
531 </p><dl> 683 </p>
684 <dl>
685
532 <dt><i>language</i></dt> 686 <dt><i>language</i></dt>
533 <dd> 687 <dd>
534 the language to be used as the default (string). 688 the language to be used as the default (string).
535 The string should be in language locale format (e.g. en_US, de). 689 The string should be in language locale format (e.g. en_US, de).
536 </dd><dt><i>pwl=</i></dt> 690 </dd>
691 <dt><i>pwl=</i></dt>
537 <dd> 692 <dd>
538 name of the personal/project word list (string) 693 name of the personal/project word list (string)
539 </dd><dt><i>pel=</i></dt> 694 </dd>
695 <dt><i>pel=</i></dt>
540 <dd> 696 <dd>
541 name of the personal/project exclude list (string) 697 name of the personal/project exclude list (string)
542 </dd> 698 </dd>
543 </dl><a NAME="SpellChecker.setMinimumWordSize" ID="SpellChecker.setMinimumWordSize"></a> 699 </dl>
700 <a NAME="SpellChecker.setMinimumWordSize" ID="SpellChecker.setMinimumWordSize"></a>
544 <h4>SpellChecker.setMinimumWordSize</h4> 701 <h4>SpellChecker.setMinimumWordSize</h4>
545 <b>setMinimumWordSize</b>(<i>size</i>) 702 <b>setMinimumWordSize</b>(<i>size</i>)
703
546 <p> 704 <p>
547 Public method to set the minimum word size. 705 Public method to set the minimum word size.
548 </p><dl> 706 </p>
707 <dl>
708
549 <dt><i>size</i></dt> 709 <dt><i>size</i></dt>
550 <dd> 710 <dd>
551 minimum word size (integer) 711 minimum word size (integer)
552 </dd> 712 </dd>
553 </dl><a NAME="SpellChecker.stopIncrementalCheck" ID="SpellChecker.stopIncrementalCheck"></a> 713 </dl>
714 <a NAME="SpellChecker.stopIncrementalCheck" ID="SpellChecker.stopIncrementalCheck"></a>
554 <h4>SpellChecker.stopIncrementalCheck</h4> 715 <h4>SpellChecker.stopIncrementalCheck</h4>
555 <b>stopIncrementalCheck</b>(<i></i>) 716 <b>stopIncrementalCheck</b>(<i></i>)
717
556 <p> 718 <p>
557 Public method to stop an incremental check. 719 Public method to stop an incremental check.
558 </p> 720 </p>
559 <div align="right"><a href="#top">Up</a></div> 721 <div align="right"><a href="#top">Up</a></div>
560 <hr /> 722 <hr />

eric ide

mercurial