示例#1
0
 def test_get_cell_parts_returns_cell_text_on_simple_cells(self):
     assert TableQuestionKnowledgeGraph._get_cell_parts('Team') == [
         ('fb:part.team', 'Team')
     ]
     assert TableQuestionKnowledgeGraph._get_cell_parts('2006') == [
         ('fb:part.2006', '2006')
     ]
     assert TableQuestionKnowledgeGraph._get_cell_parts('Wolfe Tones') == [
         ('fb:part.wolfe_tones', 'Wolfe Tones')
     ]
示例#2
0
 def test_get_cell_parts_on_past_failure_cases(self):
     parts = TableQuestionKnowledgeGraph._get_cell_parts(
         'Checco D\'Angelo\n "Jimmy"')
     assert set(parts) == {('fb:part.checco_d_angelo', "Checco D\'Angelo"),
                           ('fb:part._jimmy', '"Jimmy"')}
示例#3
0
 def test_get_cell_parts_handles_multiple_splits(self):
     parts = TableQuestionKnowledgeGraph._get_cell_parts(
         'this, has / lots\n of , commas')
     assert set(parts) == {('fb:part.this', 'this'), ('fb:part.has', 'has'),
                           ('fb:part.lots', 'lots'), ('fb:part.of', 'of'),
                           ('fb:part.commas', 'commas')}
示例#4
0
 def test_get_cell_parts_splits_on_commas(self):
     parts = TableQuestionKnowledgeGraph._get_cell_parts(
         'United States, Los Angeles')
     assert set(parts) == {('fb:part.united_states', 'United States'),
                           ('fb:part.los_angeles', 'Los Angeles')}