

def add_item(self, filepath, filetype):
    if (filetype == poioapi.data.TREEPICKLE):
        annotation_tree = poioapi.annotationtree.AnnotationTree(poioapi.data.data_structure_handler_for_type(self.data_structure_type))
        annotation_tree.load_tree_from_pickle(filepath)
        if (annotation_tree.structure_type_handler != self.data_structure_type):
            raise poioapi.data.DataStructureTypeNotCompatible('Data structure type {0} not compatible with corpusdata type {1}'.format(annotation_tree.structure_type_handler, self.data_structure_type))
        annotation_tree.init_filters()
        self.items.append((filepath, annotation_tree))
    else:
        raise poioapi.data.UnknownFileFormatError()

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