spellchecker

A python based spell checker library with support for indic languages. It can also give spelling suggestions.

spellchecker API

class spellchecker.core.Spellchecker[source]

Spellchecker Class. contains spell checking and suggestion methods.

check(word, language=None)[source]

Checks whether given word has correct spelling.

Parameters:
  • word (str.) – The word whose spelling tis to be checked.
  • languageoptional language code for the word.
Returns:

Boolean True or False

>>> a.check(u"അംഗദന്‍")
True

check_batch(text, language=None)[source]

Return a list of misspelled words give a chunk of text.

Parameters:text (str) – Input text.
Returns:list of mispelled words.
>>> a.check_batch(u"thire is only one anser")
[u'thire', u'anser']
get_info()[source]

Returns module info

get_module_name()[source]

Returns module name.

suggest(word, language=None, distance=2)[source]

Gives a list of words similar to the given word

Parameters:
  • word (str.) – The word for which spelling suggestions are required.
  • distance (int) – suggestion will contain words with length =word length +/- distance
Returns:

A list of suggested spellings.

>>> a.suggest(u"cate")
[u'cat', u'cater', u'caters', u'cats']

Indices and tables

Table Of Contents

Related Topics

This Page