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

后端 未结 12 1933
终归单人心
终归单人心 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:48

    use regular expression for split text into sentences, in use Regex but in java i dont know.

    code

    string[] sentences = Regex.Split(text, @"(?<=['""a-za-z][\)][\.\!\?])\s+(?=[A-Z])");

    90% works

提交回复
热议问题