Example usage for edu.stanford.nlp.ling IndexedWord equals

List of usage examples for edu.stanford.nlp.ling IndexedWord equals

Introduction

In this page you can find the example usage for edu.stanford.nlp.ling IndexedWord equals.

Prototype

@SuppressWarnings("RedundantIfStatement")
@Override
public boolean equals(Object o) 

Source Link

Document

This .equals is dependent only on docID, sentenceIndex, and index.

Usage

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;
}