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
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
def accept(self, cell): if is_not_empty(cell): self.pa(translate(cell))
def test_mix(self, x, y): self.assertEqual(translate(x), y)
def test_special(self, x, y): self.assertEqual(translate(x), y)
def test_encoding(self, x, y): self.assertEqual(translate(x), y)
def test_basic(self, x, y): self.assertEqual(translate(x), y)