class documentation

A reader for part-of-speech tagged corpora whose documents are divided into categories based on their file identifiers.

Method __init__ Initialize the corpus reader. Categorization arguments (cat_pattern, cat_map, and cat_file) are passed to the CategorizedCorpusReader constructor. The remaining arguments are passed to the TaggedCorpusReader...
Method paras No summary
Method raw No summary
Method sents No summary
Method tagged_paras No summary
Method tagged_sents No summary
Method tagged_words No summary
Method words No summary
Method _resolve Undocumented

Inherited from CategorizedCorpusReader:

Method categories Return a list of the categories that are defined for this corpus, or for the file(s) if it is given.
Method fileids Return a list of file identifiers for the files that make up this corpus, or that make up the given category(s) if specified.
Method _add Undocumented
Method _init Undocumented
Instance Variable _c2f Undocumented
Instance Variable _delimiter Undocumented
Instance Variable _f2c Undocumented
Instance Variable _file Undocumented
Instance Variable _map Undocumented
Instance Variable _pattern Undocumented

Inherited from TaggedCorpusReader (via CategorizedCorpusReader):

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 CategorizedCorpusReader, 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 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.
Method readme Return the contents of the corpus README file, if it exists.
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, *args, **kwargs): (source)

Initialize the corpus reader. Categorization arguments (cat_pattern, cat_map, and cat_file) are passed to the CategorizedCorpusReader constructor. The remaining arguments are passed to the TaggedCorpusReader.

def paras(self, fileids=None, categories=None): (source)
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 strings.
def raw(self, fileids=None, categories=None): (source)
Returns
strthe given file(s) as a single string.
def sents(self, fileids=None, categories=None): (source)
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, categories=None, tagset=None): (source)
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 lists of (word,tag) tuples.
def tagged_sents(self, fileids=None, categories=None, tagset=None): (source)
Returns
list(list(tuple(str,str)))the given file(s) as a list of sentences, each encoded as a list of (word,tag) tuples.
def tagged_words(self, fileids=None, categories=None, tagset=None): (source)
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, categories=None): (source)
Returns
list(str)the given file(s) as a list of words and punctuation symbols.
def _resolve(self, fileids, categories): (source)

Undocumented