Conversions: Enforcing whitespace after the left_unit to fix triggering on "seconds"
parent
d3f23dd1ac
commit
923f85bd45
|
@ -42,7 +42,7 @@ my $question_prefix = qr/(?<prefix>convert|what (?:is|are|does)|how (?:much|many
|
|||
|
||||
# guards and matches regex
|
||||
my $factor_re = join('|', ('a', 'an', number_style_regex()));
|
||||
my $guard = qr/^(?<question>$question_prefix)\s?(?<left_num>$factor_re*)\s?(?<left_unit>$keys)\s?(?<connecting_word>in|to|into|(?:in to)|from)?\s?(?<right_num>$factor_re*)\s?(?:of\s)?(?<right_unit>$keys)[\?]?$/i;
|
||||
my $guard = qr/^(?<question>$question_prefix)\s?(?<left_num>$factor_re*)\s?(?<left_unit>$keys)\s(?<connecting_word>in|to|into|(?:in to)|from)?\s?(?<right_num>$factor_re*)\s?(?:of\s)?(?<right_unit>$keys)[\?]?$/i;
|
||||
|
||||
# exceptions for pluralized forms:
|
||||
my %plural_exceptions = (
|
||||
|
|
Loading…
Reference in New Issue