Beispiel #1
0
    def _doTest(self, text, table):

        N = Normalizer( table )
        got = N.normalize(text)

        expected = text
        for old,new in table:
            expected = expected.replace(old, new)

        self.assertEqual(got, expected)
Beispiel #2
0
    def testSimple(self):
        
        N = Normalizer( [] )
        self.assertEqual(N.getTable(), [] )

        N = Normalizer( [('a','b'),('c','d'), ('a','b') ] )
        self.assertEqual(N.getTable(), [('a','b'),('c','d'), ('a','b') ]  )