def addAliasesToStack(self): synonyms = self.engine.getSynonyms(self.termAttr.term()) if synonyms is None: return current = self.captureState() for synonym in synonyms: self.save.restoreState(current) AnalyzerUtils.setTerm(self.save, synonym) AnalyzerUtils.setType(self.save, self.TOKEN_TYPE_SYNONYM) AnalyzerUtils.setPositionIncrement(self.save, 0) self.synonymStack.append(self.save.captureState())
def addAliasesToStack(self): synonyms = self.engine.getSynonyms(self.termAttr.term()) if synonyms is None: return current = self.captureState() for synonym in synonyms: self.save.restoreState(current) AnalyzerUtils.setTerm(self.save, synonym) AnalyzerUtils.setType(self.save, self.TOKEN_TYPE_SYNONYM) AnalyzerUtils.setPositionIncrement(self.save, 0) self.synonymStack.append(self.save.captureState())