How to parse text into sentences

后端 未结 7 1514
星月不相逢
星月不相逢 2020-12-06 07:31

I\'m trying to break up a paragraph into sentences. Here is my code so far:

import java.util.*;

public class StringSplit {
 public static void main(String a         


        
7条回答
  •  北荒
    北荒 (楼主)
    2020-12-06 07:43

    You can use the Class SentenceSplitter provided by this open source library here.

    SentenceSplitter sp = new SentenceSplitter("filename");
    String str = null;
    while((str = sp.next().toString()) != null)
    {
        //Your code here.
    }
    

提交回复
热议问题