query = "The child has several balls. The diameter of each ball is 1.5 cm. All the balls are blue.";
String[] sentences = query.split("\n|((?<!\\d)\\.(?!\\d))");
System.out.format("There are %d sentences in the input text:\n",
sentences.length);
Last edit: Duy Dinh 2014-09-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Last edit: Duy Dinh 2014-09-12