Ejemplo n.º 1
0
    def load_documents(self):
        """
        """
        self.new_docs = []
        for path in self.new_docs_paths:
            doc = text.Document(path)
            doc.get_sentences()
            self.new_docs.append(doc)

        self.old_docs = []
        for path in self.old_docs_paths:
            doc = text.Document(path)
            self.old_docs.append(doc)

        self.loaded_docs = True
Ejemplo n.º 2
0
def setup_simple(data_path, id='simple', title='', narr=''):
    """
    create a summary problem from a single clean (text only) input file
    """
    doc = text.Document(data_path, is_clean=True)
    problem = SummaryProblem(id, title, narr, [doc], [])
    return problem
Ejemplo n.º 3
0
    def load_documents(self):
        """
        """
        self.new_docs = []
        for path in self.new_docs_paths:
            doc = text.Document(path)
            doc.get_sentences()
            self.new_docs.append(doc)

        self.old_docs = []
        for problem in self.old_problems:
            if problem.new_docs == None:
                sys.stderr.write(
                    'ERROR: in ' + self.id +
                    ', could not find documents for old problem ' +
                    problem.id + '\n')
                sys.stderr.write('old_problems: ' +
                                 repr([x.id
                                       for x in self.old_problems]) + '\n')
                sys.exit(1)
            self.old_docs.extend(problem.new_docs)