:py:mod:`hazimp.spell_check` ============================ .. py:module:: hazimp.spell_check .. autoapi-nested-parse:: Spell checking based on http://norvig.com/spell-correct.html Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: hazimp.spell_check.SpellCheck Functions ~~~~~~~~~ .. autoapisummary:: hazimp.spell_check.edits1 hazimp.spell_check.train Attributes ~~~~~~~~~~ .. autoapisummary:: hazimp.spell_check.ALPHABET .. py:data:: ALPHABET :annotation: = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .. py:function:: edits1(word) Build a set of the word with various changes .. py:function:: train(features) Builds the nwords data structure. .. py:class:: SpellCheck(base_words) Bases: :py:obj:`object` Given a base set of works, check the spelling of a new work and suggest what base word was meant. .. py:method:: known_edits2(self, word) .. py:method:: known(self, words) .. py:method:: correct(self, word) If the word is known 'word' is returned. If the word is unknow, by 1 or 2 modifications from known words, The known word is returned Otherwise the unknown word is returned. :param word: The word that might have a typo. :returns: ??