Skip to content

Commit 338b6dc

Browse files
committed
UnknownWordSplitter: change handling of gc'd
1 parent 04108af commit 338b6dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/CheckSpelling/UnknownWordSplitter.pm

+2-1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ sub split_line {
308308
our ($ignore_pattern, $upper_pattern, $lower_pattern, $not_lower_pattern, $not_upper_or_lower_pattern, $punctuation_pattern);
309309
our @hunspell_dictionaries;
310310
our $shortest;
311+
my $shortest_threshold = $shortest + 2;
311312
my $pattern = '.';
312313
# $pattern = "(?:$upper_pattern){$shortest,}|$upper_pattern(?:$lower_pattern){2,}\n";
313314

@@ -355,7 +356,7 @@ sub split_line {
355356
}
356357
unless ($disable_word_collating) {
357358
$key =~ s/''+/'/g;
358-
$key =~ s/'[sd]$//;
359+
$key =~ s/'[sd]$// unless length $key >= $shortest_threshold;
359360
}
360361
if (defined $dictionary{$key}) {
361362
++$words;

0 commit comments

Comments
 (0)