有没有办法用逗号分割句子,使用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());
}
}