<s> import unittest <EOL> from whoosh import index , spelling , store <EOL> class TestSpelling ( unittest . TestCase ) : <EOL> def test_spelling ( self ) : <EOL> st = store . RamStorage ( ) <EOL> sp = spelling . SpellChecker ( st , mingram = <NUM_LIT:2> ) <EOL> wordlist = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> sp . add_words ( [ unicode ( w ) for w in wordlist ] ) <EOL> sugs = sp . suggest ( u"<STR_LIT>" ) <EOL> self . assert_ ( sugs ) <EOL> self . assertEqual ( sugs , [ u"<STR_LIT>" , u"<STR_LIT>" , u"<STR_LIT>" ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) <EOL> print <NUM_LIT:10> + <NUM_LIT:20> </s>
