Example usage for edu.stanford.nlp.ling WordLemmaTag WordLemmaTag

List of usage examples for edu.stanford.nlp.ling WordLemmaTag WordLemmaTag

Introduction

In this page you can find the example usage for edu.stanford.nlp.ling WordLemmaTag WordLemmaTag.

Prototype

public WordLemmaTag(String word, String lemma, String tag) 

Source Link

Document

Create a new WordLemmaTag .

Usage

From source file:edu.jhu.agiga.StanfordAgigaSentence.java

License:Open Source License

public List<WordLemmaTag> getStanfordWordLemmaTags() {
    List<AgigaToken> tokens = getTokens();
    List<WordLemmaTag> labels = new ArrayList<WordLemmaTag>();
    for (int i = 0; i < tokens.size(); i++) {
        AgigaToken at = tokens.get(i);//w  w w .j av  a 2 s  .  c om
        WordLemmaTag curToken;
        require(prefs.readWord, "AgigaPrefs.readWord must be true for getStanfordWordLemmaTags()");
        if (prefs.readWord && prefs.readLemma && prefs.readPos) {
            curToken = new WordLemmaTag(at.getWord(), at.getLemma(), at.getPosTag());
        } else if (prefs.readWord && prefs.readPos) {
            curToken = new WordLemmaTag(at.getWord(), at.getPosTag());
        } else { // if (prefs.readWord) {
            curToken = new WordLemmaTag(at.getWord());
        }
        labels.add(curToken);
    }
    return labels;
}