Example usage for edu.stanford.nlp.ling TaggedWordFactory newLabelFromString

List of usage examples for edu.stanford.nlp.ling TaggedWordFactory newLabelFromString

Introduction

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

Prototype

public Label newLabelFromString(String word) 

Source Link

Document

Create a new word, where the label is formed from the String passed in.

Usage

From source file:org.ets.research.nlp.stanford_thrift.general.CoreNLPThriftUtil.java

License:Open Source License

public static List<TaggedWord> getListOfTaggedWordsFromTaggedSentence(String taggedSentence, String divider) {
    String[] taggedTokens = taggedSentence.split(" ");
    TaggedWordFactory tf = new TaggedWordFactory(divider.charAt(0));
    List<TaggedWord> taggedWordList = new ArrayList<TaggedWord>();
    for (String taggedToken : taggedTokens) {
        taggedWordList.add((TaggedWord) tf.newLabelFromString(taggedToken));
    }// www.ja v  a2  s. c  om
    return taggedWordList;
}