Example usage for edu.stanford.nlp.ling CoreLabel setOriginalText

List of usage examples for edu.stanford.nlp.ling CoreLabel setOriginalText

Introduction

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

Prototype

@Override
public void setOriginalText(String originalText) 

Source Link

Usage

From source file:de.tudarmstadt.ukp.dkpro.core.stanfordnlp.util.CoreNlpUtils.java

License:Open Source License

public static CoreLabel tokenToWord(Token aToken) {
    CoreLabel t = new CoreLabel();

    t.setOriginalText(aToken.getCoveredText());
    t.setWord(aToken.getCoveredText());//w w  w  . j ava 2s. c  om
    t.setBeginPosition(aToken.getBegin());
    t.setEndPosition(aToken.getEnd());

    if (aToken.getLemma() != null) {
        t.setLemma(aToken.getLemma().getValue());
    }

    if (aToken.getPos() != null) {
        t.setTag(aToken.getPos().getPosValue());
    }

    return t;
}