def test_missing(self): rt = RTrie() ing_words = [u"riding", u"booking", u"dashing", "penny", "farthing"] list(map(rt.add, ing_words)) similar = list(rt.getWordsEndingWith(u"---")) # pprint(similar) self.assertEqual(len(similar), 5)
def test_missing(self): rt = RTrie() ing_words = [u'riding', u'booking', u'dashing', 'penny', 'farthing'] list(map(rt.add, ing_words)) similar = list(rt.getWordsEndingWith(u'---')) #pprint(similar) self.assertEqual(len(similar), 5)
def test_missing(self): rt = RTrie() ing_words = [u'riding',u'booking',u'dashing','penny','farthing'] list(map(rt.add,ing_words)) similar = list(rt.getWordsEndingWith(u'---')) #pprint(similar) self.assertEqual(len(similar),5)
def test_missing(self): rt = RTrie() ing_words = [u"riding", u"booking", u"dashing", "penny", "farthing"] list(map(rt.add, ing_words)) similar = list(rt.getWordsEndingWith(u"---")) # pprint(similar) self.assertEqual(len(similar), 5)
def setUp(self): rt = RTrie(is_tamil=True) rhymie = [u"மாங்குயில்", u"பூங்குயில்", u"அல்லவா", u"செல்வாயா", u"சொல்வாயா"] for wrd in rhymie: rt.add(wrd) self.rt = rt self.len = len(rhymie) return
def setUp(self): rt = RTrie(is_tamil=True) rhymie = [u"மாங்குயில்", u"பூங்குயில்", u"அல்லவா", u"செல்வாயா", u"சொல்வாயா"] for wrd in rhymie: rt.add(wrd) self.rt = rt self.len = len(rhymie) return
def test_rev_trie(self): rt = RTrie() ing_words = [u"riding", u"booking", u"dashing"] list(map(rt.add, ing_words)) words_endwith_ing = list(rt.getAllWordsPrefix(u"ing")) similar = list(rt.getWordsEndingWith(u"ing")) # pprint(similar) self.assertEqual(words_endwith_ing, similar) self.assertEqual(sorted(words_endwith_ing), sorted(ing_words)) # for x,y in zip(ing_words,words_endwith_ing): # print("%s|%s"%(x,y)) return
def test_rev_trie(self): rt = RTrie() ing_words = [u'riding',u'booking',u'dashing'] list(map(rt.add,ing_words)) words_endwith_ing = list(rt.getAllWordsPrefix(u'ing')) similar = list(rt.getWordsEndingWith(u'ing')) #pprint(similar) self.assertEqual(words_endwith_ing,similar) self.assertEqual(sorted(words_endwith_ing),sorted(ing_words)) #for x,y in zip(ing_words,words_endwith_ing): # print("%s|%s"%(x,y)) return