class documentation

Reader for corpora following the TEI-p5 xml scheme, such as MULTEXT-East. MULTEXT-East contains part-of-speech-tagged words with a quite precise tagging scheme. These tags can be converted to the Universal tagset

Method __init__ Construct a new MTECorpusreader for a set of documents located at the given root directory. Example usage:
Method lemma_paras No summary
Method lemma_sents No summary
Method lemma_words No summary
Method paras No summary
Method raw No summary
Method readme Prints some information about this corpus. :return: the content of the attached README file :rtype: str
Method sents No summary
Method tagged_paras No summary
Method tagged_sents No summary
Method tagged_words No summary
Method words No summary
Method __fileids Undocumented

Inherited from TaggedCorpusReader:

Instance Variable _para_block_reader Undocumented
Instance Variable _sent_tokenizer Undocumented
Instance Variable _sep Undocumented
Instance Variable _tagset Undocumented
Instance Variable _word_tokenizer Undocumented

Inherited from CorpusReader (via TaggedCorpusReader):

Method __repr__ Undocumented
Method abspath Return the absolute path for the given file.
Method abspaths Return a list of the absolute paths for all fileids in this corpus; or for the given list of fileids, if specified.
Method citation Return the contents of the corpus citation.bib file, if it exists.
Method encoding Return the unicode encoding for the given corpus file, if known. If the encoding is unknown, or if the given file should be processed using byte strings (str), then return None.
Method ensure_loaded Load this corpus (if it has not already been loaded). This is used by LazyCorpusLoader as a simple method that can be used to make sure a corpus is loaded -- e.g., in case a user wants to do help(some_corpus).
Method fileids Return a list of file identifiers for the fileids that make up this corpus.
Method license Return the contents of the corpus LICENSE file, if it exists.
Method open Return an open stream that can be used to read the given file. If the file's encoding is not None, then the stream will automatically decode the file's contents into unicode.
Class Variable root Undocumented
Method _get_root Undocumented
Instance Variable _encoding The default unicode encoding for the fileids that make up this corpus. If encoding is None, then the file contents are processed using byte strings.
Instance Variable _fileids A list of the relative paths for the fileids that make up this corpus.
Instance Variable _root The root directory for this corpus.
def __init__(self, root=None, fileids=None, encoding='utf8'): (source)

Construct a new MTECorpusreader for a set of documents located at the given root directory. Example usage:

>>> root = '/...path to corpus.../'
>>> reader = MTECorpusReader(root, 'oana-*.xml', 'utf8') # doctest: +SKIP
Parameters
rootThe root directory for this corpus. (default points to location in multext config file)
fileidsA list or regexp specifying the fileids in this corpus. (default is oana-en.xml)
encodingUndocumented
encondingThe encoding of the given files (default is utf8)
def lemma_paras(self, fileids=None): (source)

Parameters
fileidsA list specifying the fileids that should be used.
Returns
list(List(List(tuple(str, str))))the given file(s) as a list of paragraphs, each encoded as a list of sentences, which are in turn encoded as a list of tuples of the word and the corresponding lemma (word, lemma)
def lemma_sents(self, fileids=None): (source)

Parameters
fileidsA list specifying the fileids that should be used.
Returns
list(list(tuple(str, str)))the given file(s) as a list of sentences or utterances, each encoded as a list of tuples of the word and the corresponding lemma (word, lemma)
def lemma_words(self, fileids=None): (source)

Parameters
fileidsA list specifying the fileids that should be used.
Returns
list(tuple(str,str))the given file(s) as a list of words, the corresponding lemmas and punctuation symbols, encoded as tuples (word, lemma)
def paras(self, fileids=None): (source)

Parameters
fileidsA list specifying the fileids that should be used.
Returns
list(list(list(str)))the given file(s) as a list of paragraphs, each encoded as a list of sentences, which are in turn encoded as lists of word string
def raw(self, fileids=None): (source)

Parameters
fileidsA list specifying the fileids that should be used.
Returns
strthe given file(s) as a single string.
def readme(self): (source)

Prints some information about this corpus. :return: the content of the attached README file :rtype: str

def sents(self, fileids=None): (source)

Parameters
fileidsA list specifying the fileids that should be used.
Returns
list(list(str))the given file(s) as a list of sentences or utterances, each encoded as a list of word strings
def tagged_paras(self, fileids=None, tagset='msd', tags=''): (source)

Parameters
fileidsA list specifying the fileids that should be used.
tagsetThe tagset that should be used in the returned object, either "universal" or "msd", "msd" is the default
tagsAn MSD Tag that is used to filter all parts of the used corpus that are not more precise or at least equal to the given tag
Returns
list(list(list(tuple(str, str))))the given file(s) as a list of paragraphs, each encoded as a list of sentences, which are in turn encoded as a list of (word,tag) tuples
def tagged_sents(self, fileids=None, tagset='msd', tags=''): (source)

Parameters
fileidsA list specifying the fileids that should be used.
tagsetThe tagset that should be used in the returned object, either "universal" or "msd", "msd" is the default
tagsAn MSD Tag that is used to filter all parts of the used corpus that are not more precise or at least equal to the given tag
Returns
list(list(tuple(str, str)))the given file(s) as a list of sentences or utterances, each each encoded as a list of (word,tag) tuples
def tagged_words(self, fileids=None, tagset='msd', tags=''): (source)

Parameters
fileidsA list specifying the fileids that should be used.
tagsetThe tagset that should be used in the returned object, either "universal" or "msd", "msd" is the default
tagsAn MSD Tag that is used to filter all parts of the used corpus that are not more precise or at least equal to the given tag
Returns
list(tuple(str, str))the given file(s) as a list of tagged words and punctuation symbols encoded as tuples (word, tag)
def words(self, fileids=None): (source)

Parameters
fileidsA list specifying the fileids that should be used.
Returns
list(str)the given file(s) as a list of words and punctuation symbols.
def __fileids(self, fileids): (source)

Undocumented