Coverage for nltk.corpus.reader.nps_chat : 68%
![](keybd_closed.png)
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Natural Language Toolkit: NPS Chat Corpus Reader # # Copyright (C) 2001-2012 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT
if self._wrap_etree: return concat([XMLCorpusView(fileid, 'Session/Posts/Post', self._wrap_elt) for fileid in self.abspaths(fileids)]) else: return concat([XMLCorpusView(fileid, 'Session/Posts/Post') for fileid in self.abspaths(fileids)])
self._elt_to_words) for fileid in self.abspaths(fileids)])
def reader(elt, handler): return self._elt_to_tagged_words(elt, handler, simplify_tags) return concat([XMLCorpusView(fileid, 'Session/Posts/Post/terminals', reader) for fileid in self.abspaths(fileids)])
return LazyConcatenation(self.tagged_posts(fileids, simplify_tags))
return ElementWrapper(elt)
for t in elt.findall('t')]
tagged_post = [(self._simplify_username(t.attrib['word']), t.attrib['pos']) for t in elt.findall('t')] if simplify_tags: tagged_post = [(w, self._tag_mapping_function(t)) for (w,t) in tagged_post] return tagged_post
def _simplify_username(word): |