mirror of https://github.com/kivy/kivy.git
doc: grammatical revisions to core/spelling/__init__.py
This commit is contained in:
parent
b58d7659f9
commit
9cb99026b1
|
@ -2,12 +2,12 @@
|
||||||
Spelling
|
Spelling
|
||||||
========
|
========
|
||||||
|
|
||||||
Provide abstracted access to a range of spellchecking backends. Also provides
|
Provides abstracted access to a range of spellchecking backends as well as
|
||||||
word suggestions. The API is inspired by enchant, but other backends can be
|
word suggestions. The API is inspired by enchant but other backends can be
|
||||||
added that implement the same API.
|
added that implement the same API.
|
||||||
|
|
||||||
Spelling currently require `python-enchant` for all platform, except OSX, where
|
Spelling currently requires `python-enchant` for all platforms except OSX, where
|
||||||
a native implementation exist.
|
a native implementation exists.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
@ -92,36 +92,36 @@ class SpellingBase(object):
|
||||||
|
|
||||||
def list_languages(self):
|
def list_languages(self):
|
||||||
'''
|
'''
|
||||||
Return a list of all languages supported by the registered languages.
|
Return a list of all supported languages.
|
||||||
E.g.: ['en', 'en_GB', 'en_US', 'de', ...]
|
E.g. ['en', 'en_GB', 'en_US', 'de', ...]
|
||||||
'''
|
'''
|
||||||
raise NotImplementedError('list_languages() is not implemented '
|
raise NotImplementedError('list_languages() is not implemented '
|
||||||
'by abstract spelling base class!')
|
'by abstract spelling base class!')
|
||||||
|
|
||||||
def check(self, word):
|
def check(self, word):
|
||||||
'''
|
'''
|
||||||
If `word` is a valid word in `self._language`, return True.
|
If `word` is a valid word in `self._language` (the currently active
|
||||||
|
language), returns True. If the word shouldn't be checked, returns
|
||||||
|
None (e.g. for ''). If it is not a valid word in `self._language`,
|
||||||
|
return False.
|
||||||
|
|
||||||
:Parameters:
|
:Parameters:
|
||||||
`word` : str
|
`word` : str
|
||||||
The word to check. If the word is a valid word in the currently
|
The word to check.
|
||||||
active language, True is returned.
|
|
||||||
If the word shouldn't be checked, return None (e.g. for '').
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
raise NotImplementedError('check() not implemented by abstract ' +
|
raise NotImplementedError('check() not implemented by abstract ' +
|
||||||
'spelling base class!')
|
'spelling base class!')
|
||||||
|
|
||||||
def suggest(self, fragment):
|
def suggest(self, fragment):
|
||||||
'''
|
'''
|
||||||
For a given `fragment` (i.e., part of a word or a word by itself),
|
For a given `fragment` (i.e. part of a word or a word by itself),
|
||||||
provide corrections (`fragment` may be misspelled) or completions
|
provide corrections (`fragment` may be misspelled) or completions
|
||||||
as a list of strings.
|
as a list of strings.
|
||||||
|
|
||||||
:Parameters:
|
:Parameters:
|
||||||
`fragment` : str
|
`fragment` : str
|
||||||
The word fragment to get suggestions/corrections for.
|
The word fragment to get suggestions/corrections for.
|
||||||
E.g.: 'foo' might become 'of', 'food' or 'foot'.
|
E.g. 'foo' might become 'of', 'food' or 'foot'.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
raise NotImplementedError('suggest() not implemented by abstract ' +
|
raise NotImplementedError('suggest() not implemented by abstract ' +
|
||||||
|
|
Loading…
Reference in New Issue