Skip to content

Commit

Permalink
Fix missing sequences to ignore when splitting tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
goncaloasimoes committed Jan 11, 2023
1 parent 74a503f commit e274b96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TextUtilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private function splitTokens(string $line, int $maxLength): array
$tokens = explode(" ", $line);
$newTokens = [];
foreach ($tokens as $token) {
if (mb_strlen($token) > $maxLength) {
if (mb_strlen(str_replace($this->config->getSequencesToIgnore(), '', $token)) > $maxLength) {
$tokensWithMaxLength = str_split($token, $maxLength);
$newTokens = array_merge($newTokens, $tokensWithMaxLength);
} else {
Expand Down

0 comments on commit e274b96

Please sign in to comment.