Example #1
0
 def testBasicDictionaryCreation(self):
     wordset = uc.load_words('/usr/share/dict/words')
     self.assert_('word' in wordset)
     self.assert_(not 'WORD' in wordset)
     self.assert_('mobile\'s' in wordset)
     self.assert_('mobile' in wordset)
     self.assert_('city' in wordset)
     self.assert_(not 'seahawks' in wordset)
     self.assert_('there' in wordset)
Example #2
0
 def testWords_In_Dict(self):
     s = """The city as we imagine it, the soft city of illusion, myth,
          aspiration, and nightmare, is as real, maybe more real, than
          the hard city one can locate on maps, in statistics, in
          monographs on urban sociology and demography and architecture."""
     words = map(str.lower,uc.regex_word_search(s))
     wordset = uc.load_words('/usr/share/dict/words')
     for word in words:
         self.assertTrue(uc.word_in_dictionary(word,wordset),
                         str(word) + " not in dictionary!")