List of usage examples for edu.stanford.nlp.trees EnglishGrammaticalRelations VERBAL_MODIFIER
GrammaticalRelation VERBAL_MODIFIER
To view the source code for edu.stanford.nlp.trees EnglishGrammaticalRelations VERBAL_MODIFIER.
Click Source Link
From source file:knu.univ.lingvo.coref.Mention.java
License:Open Source License
public int getModifiers(Dictionaries dict) { if (headIndexedWord == null) return 0; int count = 0; List<Pair<GrammaticalRelation, IndexedWord>> childPairs = dependency.childPairs(headIndexedWord); for (Pair<GrammaticalRelation, IndexedWord> childPair : childPairs) { GrammaticalRelation gr = childPair.first; IndexedWord word = childPair.second; if (gr == EnglishGrammaticalRelations.ADJECTIVAL_MODIFIER || gr == EnglishGrammaticalRelations.VERBAL_MODIFIER || gr == EnglishGrammaticalRelations.RELATIVE_CLAUSE_MODIFIER || gr.toString().startsWith("prep_")) { count++;/* ww w. ja v a 2 s . c o m*/ } // add noun modifier when the mention isn't a NER if (nerString.equals("O") && gr == EnglishGrammaticalRelations.NOUN_COMPOUND_MODIFIER) { count++; } // add possessive if not a personal determiner if (gr == EnglishGrammaticalRelations.POSSESSION_MODIFIER && !dict.determiners.contains(word.lemma())) { count++; } } return count; }