eric6/QScintilla/SpellChecker.py

changeset 7900
72b88fb20261
parent 7781
607a6098cb44
child 7923
91e843545d9a
equal deleted inserted replaced
7899:ecf67e07b6e0 7900:72b88fb20261
35 """ 35 """
36 Constructor 36 Constructor
37 37
38 @param editor reference to the editor object (QScintilla.Editor) 38 @param editor reference to the editor object (QScintilla.Editor)
39 @param indicator spell checking indicator 39 @param indicator spell checking indicator
40 @keyparam defaultLanguage the language to be used as the default 40 @param defaultLanguage the language to be used as the default
41 (string). The string should be in language locale format 41 (string). The string should be in language locale format
42 (e.g. en_US, de). 42 (e.g. en_US, de).
43 @keyparam checkRegion reference to a function to check for a valid 43 @param checkRegion reference to a function to check for a valid
44 region 44 region
45 """ 45 """
46 super(SpellChecker, self).__init__(editor) 46 super(SpellChecker, self).__init__(editor)
47 47
48 self.editor = editor 48 self.editor = editor
128 """ 128 """
129 Protected class method to get a new dictionary. 129 Protected class method to get a new dictionary.
130 130
131 @param lang the language to be used as the default (string). 131 @param lang the language to be used as the default (string).
132 The string should be in language locale format (e.g. en_US, de). 132 The string should be in language locale format (e.g. en_US, de).
133 @keyparam pwl name of the personal/project word list (string) 133 @param pwl name of the personal/project word list (string)
134 @keyparam pel name of the personal/project exclude list (string) 134 @param pel name of the personal/project exclude list (string)
135 @return reference to the dictionary (enchant.Dict) 135 @return reference to the dictionary (enchant.Dict)
136 """ 136 """
137 if not pwl: 137 if not pwl:
138 pwl = SpellChecker.getUserDictionaryPath() 138 pwl = SpellChecker.getUserDictionaryPath()
139 d = os.path.dirname(pwl) 139 d = os.path.dirname(pwl)
169 """ 169 """
170 Public method to set the current language. 170 Public method to set the current language.
171 171
172 @param language the language to be used as the default (string). 172 @param language the language to be used as the default (string).
173 The string should be in language locale format (e.g. en_US, de). 173 The string should be in language locale format (e.g. en_US, de).
174 @keyparam pwl name of the personal/project word list (string) 174 @param pwl name of the personal/project word list (string)
175 @keyparam pel name of the personal/project exclude list (string) 175 @param pel name of the personal/project exclude list (string)
176 """ 176 """
177 self._spelling_lang = language 177 self._spelling_lang = language
178 self._spelling_dict = self._getDict(language, pwl=pwl, 178 self._spelling_dict = self._getDict(language, pwl=pwl,
179 pel=pel) 179 pel=pel)
180 180
314 def checkWord(self, pos, atEnd=False): 314 def checkWord(self, pos, atEnd=False):
315 """ 315 """
316 Public method to check the word at position pos. 316 Public method to check the word at position pos.
317 317
318 @param pos position to check at (integer) 318 @param pos position to check at (integer)
319 @keyparam atEnd flag indicating the position is at the end of the word 319 @param atEnd flag indicating the position is at the end of the word
320 to check (boolean) 320 to check (boolean)
321 """ 321 """
322 spell = self._spelling_dict 322 spell = self._spelling_dict
323 if spell is None: 323 if spell is None:
324 return 324 return

eric ide

mercurial