php-sentence
php-sentence copied to clipboard
"I get up at 7 a.m. every day." fail
I get up at 7 a.m. every day.
return result ['0'=>'I get up at 7 a.m.', 'every day.']
The returned result is incorrect, this sentence does not need to be split
I think the basic criteria here to handle this in code is to join 2 splits when:
- directly after a full stop is a letter a.m. (from your example it seems like this is fine)
- if the subsequent word starts with lowercase word, assuming its a continuation of the previous sentence