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