def test_annot_sentences(self): sentences = [ "It may seem obvious to just create one language for " "everybody to use.", "Luckily, several linguists felt the same way.", "They made up what we call constructed languages.", "But, languages re a big part of a people's culture " "and identity and most of them have long interesting histories.", "People aren't willing to give them up.", "It is also very hard to become fluent in a language.", "It may seem natural to you to speak English, but it is actually " "very hard for many adults to learn." ] ids = "a", "b", "c", "d", "e", "f", "g" annotator = TreeTaggerEnglish() graph_list = annotator.annot_sentences(sentences, encoding="utf-8", ids=ids) check_graph_format(graph_list) # check graph id's for graph, id in zip(graph_list, ids): assert graph.graph["id"] == id
def test_annot_xml_file(self): xml_fname = config["test_data_dir"] + "/sample_en_1.xml" annotator = TreeTaggerEnglish() graph_list = annotator.annot_xml_file(xml_fname) check_graph_format(graph_list)