Exemplo n.º 1
0
 def testUnifyTablesRemovesEmptyColumns(self):
     input = [['x', '', 'y'], ['xxx', '', 'yyyy', 'zz', '         ']]
     expected = [['x', 'y', ''], ['xxx', 'yyyy', 'zz']]
     self.assertEquals(expected, unify_table(input))
Exemplo n.º 2
0
 def testUnifyTablesRemovesEmptyColumns(self):
     input = [['x', '', 'y'], ['xxx', '', 'yyyy', 'zz', '         ']]
     expected = [['x', 'y', ''], ['xxx', 'yyyy', 'zz']]
     self.assertEquals(expected, unify_table(input))
Exemplo n.º 3
0
 def testUnifyTables(self):
     input = [[' x ', '  y'], ['xxx', ' yyyy ', 'zz']]
     expected = [[' x ', '  y', ''], ['xxx', ' yyyy ', 'zz']]
     self.assertEqual(expected, unify_table(input))
Exemplo n.º 4
0
def parse_table(raw_lines):
    row_partition = partition_raw_lines(raw_lines)
    lines = map(lambda row_string: join_rows(map(split_table_row, row_string)),
                row_partition)
    return unify_table(lines)
Exemplo n.º 5
0
def parse_table(raw_lines):
    row_partition = partition_raw_lines(raw_lines)
    lines = map(lambda row_string: join_rows(map(split_table_row, row_string)),
                row_partition)
    return unify_table(lines)