How can I split a text into sentences using the Stanford parser?

后端 未结 12 1906
终归单人心
终归单人心 2020-11-27 14:52

How can I split a text or paragraph into sentences using Stanford parser?

Is there any method that can extract sentences, such as getSentencesFromString()

12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 15:29

    You can use the document preprocessor. It's really easy. Just feed it a filename.

        for (List sentence : new DocumentPreprocessor(pathto/filename.txt)) {
             //sentence is a list of words in a sentence
        }
    

提交回复
热议问题