@Override public String toString() { return origStr + "\t" + namedEntity + "\t" + (lemmas != null && lemmas.size() == 1? lemmas.get(0): lemmas) + "\t" + posTag; } }
public String getLemma() throws LemmatizerException { if (lemmas.size() < 1) { throw new LemmatizerException("No lemmas in array"); } return lemmas.get(0); }
public String getLemma() throws InstrumentCombinationException{ if(lemmas != null && lemmas.size() == 1){ return lemmas.get(0); }else{ throw new InstrumentCombinationException("this token has more than a single lemma"); } } /**
public ChainOfLexicalRules(String lhsLemma, PartOfSpeech lhsPos, String rhsLemma, PartOfSpeech rhsPos, double confidence, ImmutableList<LexicalRuleWithName> chain) throws TeEngineMlException { super(lhsLemma, lhsPos, rhsLemma, rhsPos, confidence); this.chain = chain; if (null==chain) throw new TeEngineMlException("Null chain"); if (chain.size()==0)throw new TeEngineMlException("Empty chain"); if (!chain.get(0).getRule().getLhsLemma().equals(lhsLemma)) throw new TeEngineMlException("Bad chain: expected: "+lhsLemma+" but found: "+chain.get(0).getRule().getLhsLemma()+parametersDescription(lhsLemma, lhsPos, rhsLemma, rhsPos, confidence, chain)); if (!simplerPos(chain.get(0).getRule().getLhsPos().getCanonicalPosTag()).equals(simplerPos(lhsPos.getCanonicalPosTag()))) throw new TeEngineMlException("Bad chain: expected pos: "+simplerPos(lhsPos.getCanonicalPosTag())+", but found: "+simplerPos(chain.get(0).getRule().getLhsPos().getCanonicalPosTag())+parametersDescription(lhsLemma, lhsPos, rhsLemma, rhsPos, confidence, chain)); if (!chain.get(chain.size()-1).getRule().getRhsLemma().equals(rhsLemma)) throw new TeEngineMlException("Bad chain: expected rhsLemma: "+rhsLemma+" but found: "+chain.get(chain.size()-1).getRule().getRhsLemma()+parametersDescription(lhsLemma, lhsPos, rhsLemma, rhsPos, confidence, chain)); if (!simplerPos(chain.get(chain.size()-1).getRule().getRhsPos().getCanonicalPosTag()).equals(simplerPos(rhsPos.getCanonicalPosTag()))) throw new TeEngineMlException("Bad chain: expected rhs pos: "+simplerPos(rhsPos.getCanonicalPosTag())+", but found: "+simplerPos(chain.get(chain.size()-1).getRule().getRhsPos().getCanonicalPosTag())+parametersDescription(lhsLemma, lhsPos, rhsLemma, rhsPos, confidence, chain)); }
private void redrawRegularSeachTreeAfterUpdatingTheComponentIndex() throws VisualTracingToolException { TreeHistoryComponent component = historyComponents.get(historyComponentsIndex); String imageTitle = makeTreeImageTitle(historyComponentsIndex, component.getSpecification().toString()); createAndDrawImageInComponent(component.getTree(), component.getAffectedNodes(), imageTitle, cpe.getRegularSearchImagePane()); }
new TreeAndParentMap<ExtendedInfo, ExtendedNode>(generatedTree.getTree()); TreeHistory history = generatedTreesHistory.get(generatedTree); Specification lastSpec = history.getSpecifications().get(history.getSpecifications().size()-1);
logger.debug("Already examined: "+specsHistory.get(specsHistory.size()-1).toString());
new TreeAndParentMap<ExtendedInfo, ExtendedNode>(generatedTree.getTree()); TreeHistory history = generatedTreesHistory.get(generatedTree); Specification lastSpec = history.getSpecifications().get(history.getSpecifications().size()-1);
TreeHistory history = generatedTreesHistory.get(generatedTree); if (null==history) throw new TeEngineMlException("BUG"); Specification lastSpec = history.getSpecifications().get(history.getSpecifications().size()-1);
new TreeAndParentMap<ExtendedInfo, ExtendedNode>(generatedTree.getTree()); int sizeOfSpecs = generator.getHistoryMap().get(generatedTree).getSpecifications().size(); Specification lastSpec = generator.getHistoryMap().get(generatedTree).getSpecifications().get(sizeOfSpecs-1); double classificationScore = classifier.classify(generatedTree.getFeatureVector()); double classificationScoreForPredictions = classifierForPredictions.classify(generatedTree.getFeatureVector());
Specification lastSpec = history.getSpecifications().get(history.getSpecifications().size()-1);