Merge pull request #1189 from kbhat95/ml-conversions

Enable ml to ounces trigger
master
Zaahir Moolla 2015-06-16 16:01:46 -04:00
commit 66a0058f2c
2 changed files with 9 additions and 1 deletions

View File

@ -78,7 +78,7 @@ handle query_lc => sub {
$_ =~ s/ degrees (celsius|fahrenheit)/ $1/;
# hack - convert "oz" to "fl oz" if "ml" contained in query
s/oz/fl oz/ if(/ml/ && not /fl oz/);
s/(oz|ounces)/fl oz/ if(/ml/ && not /fl oz/);
# guard the query from spurious matches
return unless $_ =~ /$guard/;

View File

@ -583,6 +583,14 @@ ddg_goodie_test(
result => '3.381 us fluid ounces'
}
),
'75 ml to ounces' => test_zci(
'75 millilitres = 2.536 us fluid ounces',
structured_answer => {
input => ['75 millilitres'],
operation => 'Convert',
result => '2.536 us fluid ounces'
}
),
'mm in inches' => test_zci(
'1 millimeter = 0.039 inches',
structured_answer => {