List of usage examples for edu.stanford.nlp.trees Tree headTerminal
public Tree headTerminal(HeadFinder hf)
From source file:knu.univ.lingvo.coref.MentionExtractor.java
License:Open Source License
private void addFoundPair(Tree np1, Tree np2, Tree t, Set<Pair<Integer, Integer>> foundPairs) { Tree head1 = np1.headTerminal(headFinder); Tree head2 = np2.headTerminal(headFinder); int h1 = ((CoreMap) head1.label()).get(CoreAnnotations.IndexAnnotation.class) - 1; int h2 = ((CoreMap) head2.label()).get(CoreAnnotations.IndexAnnotation.class) - 1; Pair<Integer, Integer> p = new Pair<Integer, Integer>(h1, h2); foundPairs.add(p);// w w w . j ava 2s .c om }