INNER CODE UNIT · Python
__words
ElizaLo/NLP-Natural-Language-Processing · Shallow Discourse Parsing/PDTB_exploration/pdtb.py:219
def __words(self, method, lemmatize=False):
"""
Internal method used by the X_words functions to get at their
(possibly stemmed) words.
"""
lemmas = method(lemmatize=lemmatize)
return [x[0] for x in lemmas]
def arg1_pos(self, wn_format=False, lemmatize=False):
"""
Returns the list of (word, pos) pairs associated with
Arg1. lemmatize=True uses nltk.stem.WordNetStemmer() on the list.
"""
return self.arg_pos(1, wn_format=wn_format, lemmatize=lemmatize)
def arg2_pos(self, wn_format=False, lemmatize=False):
"""
Returns the list of (word, pos) pairs associated with