(description, coref_file)
return Corpus(description, sorted([from_string(doc) for doc in
                                           document_as_strings]))
Construct a new corpus from a description and a file.

        The file must contain documents in the format for the CoNLL shared
        tasks on coreference resolution, see
        http://conll.cemantix.org/2012/data.html.

        Args:
            description (str): A human-readable description of the corpus.
            coref_file (file): A text file of documents in the CoNLL format.

        Returns:
            Corpus: A corpus consisting of the documents described in
            coref_file
Construct a new corpus from a description and a file.
Construct a new corpus from a description and a file .
def from_file(description, coref_file):
        """Construct a new corpus from a description and a file.

        The file must contain documents in the format for the CoNLL shared
        tasks on coreference resolution, see
        http://conll.cemantix.org/2012/data.html.

        Args:
            description (str): A human-readable description of the corpus.
            coref_file (file): A text file of documents in the CoNLL format.

        Returns:
            Corpus: A corpus consisting of the documents described in
            coref_file
        """

        if coref_file is None:
            return []

        document_as_strings = []

        current_document = ""

        for line in coref_file.readlines():
            if line.startswith("#begin") and current_document != "":
                document_as_strings.append(current_document)
                current_document = ""
            current_document += line

        document_as_strings.append(current_document)

        return Corpus(description, sorted([from_string(doc) for doc in
                                           document_as_strings]))
def from_file ( description , coref_file ) : if coref_file is None : return [ ] document_as_strings = [ ] current_document = "" for line in coref_file . readlines ( ) : if line . startswith ( "#begin" ) and current_document != "" : document_as_strings . append ( current_document ) current_document = "" current_document += line document_as_strings . append ( current_document ) return Corpus ( description , sorted ( [ from_string ( doc ) for doc in document_as_strings ] ) )