Alfred unit converter is a smart calculator for Alfred with support for unit conversions to make it a bit comparable to the Google Calculator and Wolfram Alpha.
If I enter "10 pounds to ounce", I only see one result, "160 ounce mass". However, if I enter "100 pounds to ounces", I see all units instead of just ounces. This seems to be because the Unit.others(self, keyword=None) function does not check for keyword matches to unit aliases (annotations) before outputting the full list of units.
This also applies to other units with aliases (foot/feet, lb/lbs, litre/liter/liters, gigabyte/GB, etc.).
This PR adds to Unit.others() a check for an exact match of the keyword to any of the annotations when generating the filtered list new_tos.
Hi again,
If I enter "10 pounds to ounce", I only see one result, "160 ounce mass". However, if I enter "100 pounds to ounces", I see all units instead of just ounces. This seems to be because the
Unit.others(self, keyword=None)
function does not check for keyword matches to unit aliases (annotations) before outputting the full list of units. This also applies to other units with aliases (foot/feet, lb/lbs, litre/liter/liters, gigabyte/GB, etc.).This PR adds to
Unit.others()
a check for an exact match of the keyword to any of the annotations when generating the filtered listnew_tos
.