John de Michele wrote:Vinod:
Welcome to Java Ranch!
Just for clarification, are you saying that the sentences in your text run with no newlines or carriage returns?
jittu goud wrote:can you try the following ...instead of [.]
A line terminator is a one- or two-character sequence that marks the end of a line of the input character sequence. The following are recognized as line terminators:
* A newline (line feed) character ('\n'),
* A carriage-return character followed immediately by a newline character ("\r\n"),
* A standalone carriage-return character ('\r'),
jittu goud wrote:or normally a fullstop would be followed by white space you can do this
String sentencesInParagraph = paragraph.split("[.][\\s]");
Campbell Ritchie wrote:That will only work until somebody calls you J. Goud . . .
Rob Prime wrote:There is no foolproof algorithm for this. Even human beings can misread a sentence, ending early or late because they miss a period or misinterpret a period as something that is not the sentence end.
Rob Prime wrote:Sure you can. You may split them initially, but you can paste them back together.
For instance, if the last "sentence" ends with "<>Ph." (with <> being anything other than numbers and letters), and the next sentence equals "D.", then you should paste these two sentences and the next one into one larger sentence.
hmmm.. but i will need to check so many conditions.. my code will b FULL of if statements..