Example usage for edu.stanford.nlp.trees EnglishGrammaticalRelations DETERMINER

List of usage examples for edu.stanford.nlp.trees EnglishGrammaticalRelations DETERMINER

Introduction

In this page you can find the example usage for edu.stanford.nlp.trees EnglishGrammaticalRelations DETERMINER.

Prototype

GrammaticalRelation DETERMINER

To view the source code for edu.stanford.nlp.trees EnglishGrammaticalRelations DETERMINER.

Click Source Link

Document

The "determiner" grammatical relation.

Usage

From source file:knu.univ.lingvo.coref.Mention.java

License:Open Source License

public String getQuantification(Dictionaries dict) {

    if (headIndexedWord == null)
        return null;

    if (!nerString.equals("O"))
        return "definite";

    List<IndexedWord> quant = dependency.getChildrenWithReln(headIndexedWord,
            EnglishGrammaticalRelations.DETERMINER);
    List<IndexedWord> poss = dependency.getChildrenWithReln(headIndexedWord,
            EnglishGrammaticalRelations.POSSESSION_MODIFIER);
    String det = "";
    if (!quant.isEmpty()) {
        det = quant.get(0).lemma();//from   w w w  . jav a 2  s.  c  o  m
        if (dict.determiners.contains(det)) {
            return "definite";
        }
    } else if (!poss.isEmpty()) {
        return "definite";
    } else {
        quant = dependency.getChildrenWithReln(headIndexedWord, EnglishGrammaticalRelations.NUMERIC_MODIFIER);
        if (dict.quantifiers2.contains(det) || !quant.isEmpty()) {
            return "quantified";
        }
    }
    return "indefinite";
}