List of usage examples for edu.stanford.nlp.ling IndexedWord equals
@SuppressWarnings("RedundantIfStatement") @Override public boolean equals(Object o)
From source file:semRewrite.datesandnumber.DatesAndDuration.java
License:Open Source License
/** *************************************************************** *//* w ww . j ava2s . c o m*/ public IndexedWord getAssociatedWord(Utilities utilities, IndexedWord tempParent) { while (!tempParent.equals(utilities.StanfordDependencies.getFirstRoot())) { tempParent = utilities.StanfordDependencies.getParent(tempParent); if (Utilities.VerbTags.contains(tempParent.tag()) || Utilities.nounTags.contains(tempParent.tag())) { break; } } return tempParent; }
From source file:semRewrite.datesandnumber.Utilities.java
License:Open Source License
/** *************************************************************** *//* www. j a v a2 s . co m*/ public String populateRootWord(int wordIndex) { IndexedWord tempParent = StanfordDependencies.getNodeByIndex(wordIndex); while (!tempParent.equals(StanfordDependencies.getFirstRoot())) { tempParent = StanfordDependencies.getParent(tempParent); if (containsIndexWord(tempParent.tag())) { return tempParent.word() + "-" + tempParent.index(); } } return null; }