INNER CODE UNIT · Python
sup1_words
ElizaLo/NLP-Natural-Language-Processing · Shallow Discourse Parsing/PDTB_exploration/pdtb.py:208
def sup1_words(self, lemmatize=False):
return self.__words(self.sup1_pos, lemmatize=lemmatize)
def sup2_words(self, lemmatize=False):
"""
Returns the list of words associated with Sup1 (if
any). lemmatize=True uses nltk.stem.WordNetStemmer() on the
list.
"""
return self.__words(self.sup2_pos, lemmatize=lemmatize)
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]