def file_clean(self, filename): from docutone.core.document import LawDocument if (filename.endswith(".txt")): ofile = filename else: ofile = docutonelocate.convert_file(filename) lawdoc = LawDocument() document = lawdoc.get_fusion_document(ofile) for sentence in document: print(' '.join(sentence))
def file_named_tag(self, filename): from docutone.core.document import LawDocument if (filename.endswith(".txt")): ofile = filename else: ofile = docutonelocate.convert_file(filename) lawdoc = LawDocument() document = lawdoc.get_fusion_document(ofile) self.new_ner = {} for sentence in document: self.get_sentence_named_tag(sentence) self.write_ner()