Closed lisfox1 closed 2 years ago
same issue here:
$text = 'If at 8:00 pm, do something, there is a good chance that by 8:45 pm we do something else. This is another sentence.'; $Sentence = new Sentence(); $Sentence->split($text);
Array ( [0] => If at c9f0f895fb98ab9159f51fd0297e236d:00 pm, do something, there is a good chance that by c9f0f895fb98ab9159f51fd0297e236d:45 pm we do something else. [1] => This is another sentence. )
Looking into this. It appears the numbers in hash is recursively replaced. Looking for a clean way to fix this.
Should be fixed in code. Have yet to bump version for package
Thanks for fixing it! Updating the code fixed these texts, but not this one: "It comes from 11 to 12 years of age. It lasts from age 11 to about 15."
Array( [0] => It comes from 6512bd43d9caa6e02c990b0a82652dca to 12 years of age. [1] => It lasts from age 6512bd43d9caa6e02c990b0a82652dca to about 15. )
Was still doing some recursive replacing due to "12" appearing in the hash. Current code should do single replacements only, which prevent this. Also generalized the code a bit for some possible future improvements.
Thanks!
Sentence::floatNumberClean
doesn't work as intended, it replaces numbers inside tokens when multiple number needs to be tokenise, which causes tokens in the text to be wrong so they cannot be parse back to numbers onSentence::floatNumberRevert
. This issue also can causeError: Allowed memory size of 536870912 bytes exhausted
exception due to the size of the tokens.Test:
Expected:
Actual: