use of edu.cmu.lti.chineseNLP.util.Tree in project lucida by claritylab.
the class FocusFinder method findFocusTerm.
/**
* Finds the focus word, given a Tree.
*
* @param tree The syntactic parse tree object
* @return the focus word as a Term or null, if one does not exist
*/
public static Term findFocusTerm(Tree tree) {
try {
Tree t = findFocusNode(tree);
if (t != null) {
Term res = new Term(0, 0, TreeHelper.getLeaves(t));
res.setPOS(t.getLabel());
return res;
}
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
Aggregations