-1

I want to split sentences from a paragraph using java language. Consider the following sentence.

we decided to go to u.s.a, canada,africa etc... from our office. I have only rs.1 lakh. So i called my dad and asked some money. he said "No.I wont" and disconnected the phone

.

I used stanford tokenizer. Eventhough the sentence we decided to go to u.s.a, canada,africa etc... from our office is a single sentence, output showing that

we decided to go to u.s.a, canada,africa etc...

is one sentence and

from our office

is another sentence. Rest of the sentences are correctly splitting.

Please note : if the word is etc., instead of etc... it is working correctly.

Is it possible to tell the program that the words followings etc... are the continuation of the same sentence ? I tried some other sentence spliting tools also. But the result is same. Please help.

din_oops
  • 698
  • 1
  • 9
  • 27
  • make change in your sentence. use etc, instead of etc... its grametrically wrong – Muneeb Nasir May 02 '15 at 10:25
  • i know that sentence is wrong. Im asking Is it possible to tell the program that the words followings etc... are the continuation of the same sentence ? – din_oops May 02 '15 at 10:30

1 Answers1

1

Use the replace function to replace ... With something unique. *+&1 for example. Then split the string and then replace the unique part with ... Again.

Robin Dijkhof
  • 18,665
  • 11
  • 65
  • 116