Example usage for edu.stanford.nlp.ling SentenceUtils listToString

List of usage examples for edu.stanford.nlp.ling SentenceUtils listToString

Introduction

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

Prototype

public static <T extends CoreMap> String listToString(List<T> list, String... keys) 

Source Link

Document

Pretty print CoreMap classes using the same semantics as the toShorterString method.

Usage

From source file:edu.cmu.ark.nlp.question.QuestionUtil.java

License:Open Source License

public static List<String> getSentences(String document) {
    List<String> res = new ArrayList<String>();
    StringReader reader = new StringReader(preprocess(document));

    DocumentPreprocessor docPreprocessor = new DocumentPreprocessor(reader);

    for (List<HasWord> sentence : docPreprocessor) {
        res.add(SentenceUtils.listToString(sentence, true));
    }/*from  www .  j  ava2s.c o m*/

    return res;
}