Conversions: Expanding the unit bodging for Ounces (#1767); I incorrectly diagnosed the issue, as it's actually broken due to amiguity around "ounces"

master
Rob Emery 2016-01-08 13:05:26 +00:00
parent 74ea62d38d
commit 02a9ce86ee
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -640,11 +640,11 @@ ddg_goodie_test(
}
),
'how many ounces in a cup' => test_zci(
'1 us cup = 16 fluid ounces',
'1 us cup = 8 us fluid ounces',
structured_answer => {
input => ['1 us cup'],
operation => 'convert',
result => '16 fluid ounces'
result => '8 us fluid ounces'
}
),
# Unusual number formats