Exemple #1
0
def translate1(inputs):

    inputs = [i for i in inputs if filter1(i)]
    inputs = [lower(i) for i in inputs]
    inputs = [count(i) for i in inputs]

    p = [translate(i) for i in inputs if len(i.strip()) > 0]
    p = sorted(p, key=functools.cmp_to_key(pattern_comparator))
    return p
Exemple #2
0
def translate2(inputs):
    p=[]
    for i in inputs:
        if filter1(i):
            i=lower(i)
            i=count(i)
            p.append(translate(i))
    p = sorted(p, key=functools.cmp_to_key(pattern_comparator))

    return p
Exemple #3
0
 def accept(self, cell):
     if is_not_empty(cell):
         self.pa(translate(cell))
Exemple #4
0
 def test_mix(self, x, y):
     self.assertEqual(translate(x), y)
Exemple #5
0
 def test_special(self, x, y):
     self.assertEqual(translate(x), y)
Exemple #6
0
 def test_encoding(self, x, y):
     self.assertEqual(translate(x), y)
Exemple #7
0
 def test_basic(self, x, y):
     self.assertEqual(translate(x), y)