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

后端 未结 12 1905
终归单人心
终归单人心 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条回答
  •  -上瘾入骨i
    2020-11-27 15:23

    public class k {
    
    public static void main(String a[]){
    
        String str = "This program splits a string based on space";
        String[] words = str.split(" ");
        for(String s:words){
            System.out.println(s);
        }
        str = "This     program  splits a string based on space";
        words = str.split("\\s+");
    }
    }
    

提交回复
热议问题