Add force conversions and category fixes
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user