Here us a point i am stuck again using regular expression with PHP
preg_split()
function.
Here is the code :
preg_split('~("[^"]*")|[!?.।]+\s*|\R+~u', $paragraph, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
I am trying to split a paragraph into sentences. This code does the job for me.
here is a link to my previous question
But, now I need to keep the punctuation intact(the question marks, full stop etc.).
using the PREG_SPLIT_DELIM_CAPTURE
is supposed to have done that job but somehow it's not working that way. I get only sentences, without the full-stop or question marks.