def load_cards(path): csv = CSV.load(path) cards = [] for text_xml, sentence_index, chunk_index in csv: text = Text.from_xml(encode_utf8(text_xml)) card = Card(text, int(sentence_index), int(chunk_index)) cards.append(card) return cards
def test_encode_utf8(self): # Assert Python bytestring. for s in self.strings: self.assertTrue(isinstance(db.encode_utf8(s), str)) print "pattern.db.encode_utf8()"