

def add_item(self, filepath, filetype):
    annotation_graph = poioapi.annotationgraph.AnnotationGraph(None)
    if (filetype == poioapi.data.EAF):
        annotation_graph.from_elan(filepath)
    if (filetype == poioapi.data.EAFFROMTOOLBOX):
        annotation_graph.from_elan(filepath)
    elif (filetype == poioapi.data.TYPECRAFT):
        annotation_graph.from_typecraft(filepath)
    else:
        raise poioapi.data.UnknownFileFormatError()
    annotation_graph.structure_type_handler = poioapi.data.DataStructureType(annotation_graph.tier_hierarchies[0])
    self.append((filepath, annotation_graph))

dataset/ETHPy150Open cidles/poio-api/src/poioapi/corpus.py CorpusGraphs.add_item/original