Example usage for edu.stanford.nlp.trees UniversalEnglishGrammaticalRelations PHRASAL_VERB_PARTICLE

List of usage examples for edu.stanford.nlp.trees UniversalEnglishGrammaticalRelations PHRASAL_VERB_PARTICLE

Introduction

In this page you can find the example usage for edu.stanford.nlp.trees UniversalEnglishGrammaticalRelations PHRASAL_VERB_PARTICLE.

Prototype

GrammaticalRelation PHRASAL_VERB_PARTICLE

To view the source code for edu.stanford.nlp.trees UniversalEnglishGrammaticalRelations PHRASAL_VERB_PARTICLE.

Click Source Link

Document

The "phrasal verb particle" grammatical relation.

Usage

From source file:edu.anu.spice.SpiceParser.java

License:Open Source License

/**
 * Attaches particles to the main predicate.
 *///w  w w.  j  a v  a 2 s . com
protected String getPredicate(SemanticGraph sg, IndexedWord mainPred) {
    if (sg.hasChildWithReln(mainPred, UniversalEnglishGrammaticalRelations.PHRASAL_VERB_PARTICLE)) {
        IndexedWord part = sg.getChildWithReln(mainPred,
                UniversalEnglishGrammaticalRelations.PHRASAL_VERB_PARTICLE);
        return String.format("%s %s", mainPred.lemma().equals("be") ? "" : mainPred.lemma(), part.value());
    }
    return mainPred.lemma();
}