Conversions: Adding "number of" for question prefix as suggested by @moollaza
parent
6a977c5fc1
commit
883e501cea
|
@ -38,7 +38,7 @@ triggers any => @units;
|
|||
|
||||
# match longest possible key (some keys are sub-keys of other keys):
|
||||
my $keys = join '|', reverse sort { length($a) <=> length($b) } @units;
|
||||
my $question_prefix = qr/(?<prefix>convert|what (?:is|are|does)|how (?:much|many|long) (?:is|are)?)?/;
|
||||
my $question_prefix = qr/(?<prefix>convert|what (?:is|are|does)|how (?:much|many|long) (?:is|are)?|(?:number of))?/;
|
||||
|
||||
# guards and matches regex
|
||||
my $factor_re = join('|', ('a', 'an', number_style_regex()));
|
||||
|
|
|
@ -112,6 +112,7 @@ ddg_goodie_test(
|
|||
'how much is a liter in gallons?' => test_zci('1 litre = 0.264 us gallons', html => '-ANY-'),
|
||||
'how much is a gallon in litres?' => test_zci('1 us gallon = 3.785 litres', html => '-ANY-'),
|
||||
'how many gallons in a litre' => test_zci('1 litre = 0.264 us gallons', html => '-ANY-'),
|
||||
'number of cm in 100 m' => test_zci('100 meters = 10,000 centimeters', html => '-ANY-'),
|
||||
# Intentionally untriggered
|
||||
'5 inches in 5 meters' => undef,
|
||||
'convert 1 cm to 2 mm' => undef,
|
||||
|
|
Loading…
Reference in New Issue