// the focus word in the sentence.
Iterator<DependencyPath> pathIter =
new FilteredDependencyIterator(nodes[i], acceptor, 1);
while (pathIter.hasNext()) {
DependencyPath path = pathIter.next();
DependencyTreeNode last = path.last();
// Reject words that are not nouns, verbs, or adjectives.
if (!(last.pos().startsWith("N") ||
last.pos().startsWith("J") ||
last.pos().startsWith("V")))
continue;
// Get the feature index for the co-occurring word.
String otherTerm = last.word();
// Skip any filtered features.
if (otherTerm.equals(EMPTY_STRING))
continue;
int featureIndex = termBasis.getDimension(otherTerm);
Pair<String> p = new Pair<String>(focusWord, otherTerm);
Double curCount = localLemmaCounts.get(p);
localLemmaCounts.put(p, (curCount == null)
? 1 : 1 + curCount);
// Create a RelationTuple as a local key that records this
// relation tuple occurrence. If there is not a local
// relation vector, create it. Then add an occurrence count
// of 1.
DependencyRelation relation = path.iterator().next();
// Skip relations that do not have the focusWord as the
// head word in the relation. The inverse relation will
// eventually be encountered and we'll account for it then.
if (!relation.headNode().word().equals(focusWord))