class documentation

Undocumented

Method __init__ Corpus reader designed to work with National Corpus of Polish. See http://nkjp.pl/ for more details about NKJP. use example: import nltk import nkjp from nkjp import NKJPCorpusReader x = NKJPCorpusReader(root='/home/USER/nltk_data/corpora/nkjp/', fileids='') # obtain the whole corpus x...
Method add_root Add root if necessary to specified fileid.
Method fileids Returns a list of file identifiers for the fileids that make up this corpus.
Method get_paths Undocumented
Method header Returns header(s) of specified fileids.
Method raw Returns words in specified fileids.
Method sents Returns sentences in specified fileids.
Method tagged_words Call with specified tags as a list, e.g. tags=['subst', 'comp']. Returns tagged words in specified fileids.
Method words Returns words in specified fileids.
Constant HEADER_MODE Undocumented
Constant RAW_MODE Undocumented
Constant SENTS_MODE Undocumented
Constant WORDS_MODE Undocumented
Method _view Returns a view specialised for use with particular corpus file.
Instance Variable _paths Undocumented

Inherited from XMLCorpusReader:

Method xml Undocumented
Instance Variable _wrap_etree Undocumented

Inherited from CorpusReader (via XMLCorpusReader):

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.
Instance Variable _tagset Undocumented
def __init__(self, root, fileids='.*'): (source)

Corpus reader designed to work with National Corpus of Polish. See http://nkjp.pl/ for more details about NKJP. use example: import nltk import nkjp from nkjp import NKJPCorpusReader x = NKJPCorpusReader(root='/home/USER/nltk_data/corpora/nkjp/', fileids='') # obtain the whole corpus x.header() x.raw() x.words() x.tagged_words(tags=['subst', 'comp']) #Link to find more tags: nkjp.pl/poliqarp/help/ense2.html x.sents() x = NKJPCorpusReader(root='/home/USER/nltk_data/corpora/nkjp/', fileids='Wilk*') # obtain particular file(s) x.header(fileids=['WilkDom', '/home/USER/nltk_data/corpora/nkjp/WilkWilczy']) x.tagged_words(fileids=['WilkDom', '/home/USER/nltk_data/corpora/nkjp/WilkWilczy'], tags=['subst', 'comp'])

def add_root(self, fileid): (source)

Add root if necessary to specified fileid.

def fileids(self): (source)

Returns a list of file identifiers for the fileids that make up this corpus.

def get_paths(self): (source)

Undocumented

@_parse_args
def header(self, fileids=None, **kwargs): (source)

Returns header(s) of specified fileids.

@_parse_args
def raw(self, fileids=None, **kwargs): (source)

Returns words in specified fileids.

@_parse_args
def sents(self, fileids=None, **kwargs): (source)

Returns sentences in specified fileids.

@_parse_args
def tagged_words(self, fileids=None, **kwargs): (source)

Call with specified tags as a list, e.g. tags=['subst', 'comp']. Returns tagged words in specified fileids.

@_parse_args
def words(self, fileids=None, **kwargs): (source)

Returns words in specified fileids.

HEADER_MODE: int = (source)

Undocumented

Value
2
RAW_MODE: int = (source)

Undocumented

Value
3
SENTS_MODE: int = (source)

Undocumented

Value
1
WORDS_MODE: int = (source)

Undocumented

Value
0
def _view(self, filename, tags=None, **kwargs): (source)

Returns a view specialised for use with particular corpus file.

Undocumented