コード例 #1
0
 def test_read_from_line_handles_multiple_columns(self):
     index = 23
     tuple_string = "this###is###a triple"
     label = True
     line = "%d\t%s\t%d" % (index, tuple_string, int(label))
     instance = TupleInstance.read_from_line(line)
     assert instance.text == ["this", "is", "a triple"]
     assert instance.label is label
     assert instance.index == index
コード例 #2
0
 def test_words_tokenizes_the_tuple_correctly(self):
     t = TupleInstance(["This", "is", "a triple"])
     assert t.words() == {'words': ['this', 'is', 'a', 'triple']}
コード例 #3
0
 def test_read_from_line_splits_correctly(self):
     line = "this###is###a triple"
     instance = TupleInstance.read_from_line(line)
     assert instance.text == ["this", "is", "a triple"]