Add force conversions and category fixes

This commit is contained in:
Codex
2026-03-07 10:21:05 +00:00
parent 4e6b54ce24
commit a72ebc014c
3 changed files with 100 additions and 35 deletions

View File

@@ -55,6 +55,7 @@ def split_conversion_name(name):
def guess_category(name):
name_l = name.lower()
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'
@@ -70,7 +71,6 @@ def guess_category(name):
if any(x in name_l for x in ['binary', 'hex', 'octal', 'decimal', 'ascii', 'fraction']): return 'number-systems'
if any(x in name_l for x in ['becquerel', 'curie', 'gray', 'rad', 'sievert', 'rem', 'roentgen', 'rutherford']): return 'radiation'
if any(x in name_l for x in ['volt', 'amp', 'ohm', 'siemens', 'farad', 'henry', 'coulomb']): return 'electrical'
if any(x in name_l for x in ['newton', 'dyne', 'foot-pound']): return 'force'
if any(x in name_l for x in ['lumen', 'lux', 'candela']): return 'light'
return 'other'