使用stanford nlp api用逗号分隔句子?

时间:2016-11-30 16:54:09

标签: java parsing split stanford-nlp

有没有办法用逗号分割句子,使用stanford nlp api?

这是我的代码:

 public void splitSentences(String paragraph, List<String> sentences){
    Reader reader = new StringReader(paragraph);
    DocumentPreprocessor dp = new DocumentPreprocessor(reader);
    for (List<HasWord> sentence : dp) {
       String sentenceString = Sentence.listToString(sentence);
       sentences.add(sentenceString.toString());
    }
}

0 个答案:

没有答案