def load(self, path=None): _Sentiment.load(self, path) # Map "verschrikkelijk" to adverbial "verschrikkelijke" (+1%) if not path: for w, pos in list(dict.items(self)): if "JJ" in pos: p, s, i = pos["JJ"] self.annotate(attributive(w), "JJ", p, s, i)
def load(self, path=None): _Sentiment.load(self, path) # Map "terrible" to adverb "terribly" (+1% accuracy) if not path: for w, pos in list(dict.items(self)): if "JJ" in pos: if w.endswith("y"): w = w[:-1] + "i" if w.endswith("le"): w = w[:-2] p, s, i = pos["JJ"] self.annotate(w + "ly", "RB", p, s, i)
def load(self, path=None): _Sentiment.load(self, path) # Map "précaire" to "precaire" (without diacritics, +1% accuracy). if not path: for w, pos in list(dict.items(self)): w0 = w if not w.endswith(("à", "è", "é", "ê", "ï")): w = w.replace("à", "a") w = w.replace("é", "e") w = w.replace("è", "e") w = w.replace("ê", "e") w = w.replace("ï", "i") if w != w0: for pos, (p, s, i) in list(pos.items()): self.annotate(w, pos, p, s, i)