php-sentence icon indicating copy to clipboard operation
php-sentence copied to clipboard

"I get up at 7 a.m. every day." fail

Open thaikhac opened this issue 2 years ago • 1 comments

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

thaikhac avatar Apr 06 '23 04:04 thaikhac

I think the basic criteria here to handle this in code is to join 2 splits when:

  1. directly after a full stop is a letter a.m. (from your example it seems like this is fine)
  2. if the subsequent word starts with lowercase word, assuming its a continuation of the previous sentence

scotteuser avatar Oct 07 '24 07:10 scotteuser