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

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

Introduction

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

Prototype

public TaggedWordFactory(char divider) 

Source Link

Document

Create a new TaggedWordFactory.

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));
    }/*from w ww  .  ja va2s. c o m*/
    return taggedWordList;
}