def test_load_n_save(self):
     reloadTMP = Trie.deserializeFromFile(self.fname)
     self.assertEqual(reloadTMP.getSize(),len(self.wl))
     self.assertTrue(reloadTMP.isWord(u'groups'))
     self.assertTrue(reloadTMP.isWord(u'rings'))
     self.assertEqual(list(reloadTMP.getAllWords()),list(self.TMP.getAllWords()))
     for wl in reloadTMP.getAllWords():
         print(wl)
     return
 def test_load_n_save(self):
     reloadTMP = Trie.deserializeFromFile(self.fname)
     self.assertEqual(reloadTMP.getSize(), len(self.wl))
     self.assertTrue(reloadTMP.isWord(u"groups"))
     self.assertTrue(reloadTMP.isWord(u"rings"))
     self.assertEqual(list(reloadTMP.getAllWords()), list(self.TMP.getAllWords()))
     for wl in reloadTMP.getAllWords():
         print(wl)
     return
示例#3
0
 def setUp(self):
     self.fname = "data.dot"
     self.wl = [u"abelian", u"commutative", u"monoid", u"rings", u"groups"]
     self.TMP, self.TMPVocabSize = DictionaryBuilder.createUsingWordList(
         self.wl)
     Trie.serializeToFile(self.TMP, self.fname)
 def setUp(self):
     self.fname = 'data.dot'
     self.wl = [u'abelian',u'commutative',u'monoid',u'rings',u'groups']
     self.TMP,self.TMPVocabSize = DictionaryBuilder.createUsingWordList(self.wl)
     Trie.serializeToFile(self.TMP,self.fname)
示例#5
0
 def setUp(self):
     self.fname = 'data.dot'
     self.wl = [u'abelian', u'commutative', u'monoid', u'rings', u'groups']
     self.TMP, self.TMPVocabSize = DictionaryBuilder.createUsingWordList(
         self.wl)
     Trie.serializeToFile(self.TMP, self.fname)