php-sentence
php-sentence copied to clipboard
Simple text sentence splitting and counting. Supports atleast english, german and dutch, possibly more. If you find it works well enough for your language, please let me know!
I get above warning for some of my content. The problem happens in the trim() method: https://github.com/vanderlee/php-sentence/blob/ed7ce41ef815bd21e61f62b692418740f988451f/src/Multibyte.php#L57-L60 When the warning is throw, mb_ereg_replace will return false instead of a string,...
I'm always asked "Whats the secret to success?". The secret is there is no secret. Be humble, hungry and the hardest. return result Array ( [0] => I'm always asked...
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...
Original text is transformed in the return sentences, so finding the start/end of each sentence requires comparing to a transformed sentence. ie For text ``` Super Tortas is Sun Valley...
1. Set Lofty Goals. 2. Visualize Success. 3. Learn from Others. I. Set Lofty Goals. II. Visualize Success. XI. Learn from Others. a. Set Lofty Goals. b. Visualize Success. c....
``` $text = "'Quoted text!'.\nAnother line"; // Create a new instance $Sentence = new \Vanderlee\Sentence\Sentence(); // Split into array of sentences $sentences = $Sentence->split($text); var_dump($sentences); ``` End of the quote...
The library has been really useful to us to break text into sentences. I've noticed one issue so far. Seems like if a sentence ends with an acronym at the...
Hey, why this logic? What if someone writes: > See it. Report it. Sorted. Will "Sorted." get ignored?