Add next temperature conversions

This commit is contained in:
Codex
2026-03-07 19:03:20 +00:00
parent 48659e63c3
commit d506e9e69e
3 changed files with 111 additions and 37 deletions

View File

@@ -55,10 +55,12 @@ def split_conversion_name(name):
def guess_category(name):
name_l = name.lower()
if 'temp scale' in name_l or 'newton (temp' in name_l:
return 'temperature'
if any(x in name_l for x in ['force', 'torque', 'newton', 'dyne', 'foot-pound']): return 'force'
if any(x in name_l for x in ['meter', 'inch', 'feet', 'yard', 'mile', 'cable', 'fathom', 'rod', 'chain', 'nautical', 'league']): return 'length'
if any(x in name_l for x in ['gram', 'pound', 'ounce', 'carat', 'stone', 'slug', 'ton', 'pennyweight', 'grain', 'momme']): return 'weight'
if any(x in name_l for x in ['celsius', 'fahrenheit', 'kelvin', 'rankine']): return 'temperature'
if any(x in name_l for x in ['celsius', 'fahrenheit', 'kelvin', 'rankine', 'delisle', 'reaumur', 'réaumur', 'romer', 'rømer']): return 'temperature'
if any(x in name_l for x in ['liter', 'gallon', 'cup', 'pint', 'quart', 'fluid', 'milliliter', 'spoon', 'drop']): return 'volume'
if any(x in name_l for x in ['acre', 'hectare', 'square']): return 'area'
if ' per ' in name_l or 'knot' in name_l or 'mach' in name_l or 'rpm' in name_l: return 'speed' # RPM might be frequency, close enough