Add fluids category

This commit is contained in:
Codex
2026-03-07 21:35:28 +00:00
parent 6ec90aef9a
commit 067d615b53
3 changed files with 110 additions and 41 deletions

View File

@@ -59,17 +59,17 @@ def guess_category(name):
return 'volume'
if 'temp scale' in name_l or 'newton (temp' in name_l:
return 'temperature'
if any(x in name_l for x in ['flow', 'mass flux', 'volumetric', 'permeability', 'viscosity', 'kinematic', 'surface tension', 'molar', 'concentration', 'flux density', 'flow rate']): return 'fluids'
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 ['acre', 'hectare', 'square']): return 'area'
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', '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 ' 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
if any(x in name_l for x in ['pascal', 'bar', 'psi', 'atmosphere', 'mmhg', 'torr', 'water', 'mercury']): return 'pressure'
if any(x in name_l for x in ['magnet', 'magnetic', 'tesla', 'gauss', 'oersted', 'weber', 'maxwell', 'gilbert', 'ampere-turn', 'ampere turns', 'ampere per meter', 'magnetomotive']): return 'magnetism'
if any(x in name_l for x in ['joule', 'calorie', 'btu', 'erg', 'therm', 'electron-volt']): return 'energy'
if any(x in name_l for x in ['thermal', 'heat', 'flux', 'conductivity', 'resistance', 'capacity', 'expansion', 'transfer']): return 'temperature'
if any(x in name_l for x in ['thermal', 'heat', 'conductivity', 'resistance', 'capacity', 'expansion', 'transfer']): return 'temperature'
if any(x in name_l for x in ['watt', 'horsepower']): return 'power'
if any(x in name_l for x in ['byte', 'bit', 'nibble', 'baud']): return 'data'
if 'light' in name_l or any(x in name_l for x in ['lumen', 'lux', 'candela']): return 'light'
@@ -78,6 +78,7 @@ 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 ' 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
if any(x in name_l for x in ['binary', 'hex', 'octal', 'decimal', 'base']):
return 'number-systems'
return 'other'