Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Units of Measure #18

Open
13 tasks
parasyte opened this issue Dec 19, 2021 · 0 comments
Open
13 tasks

Units of Measure #18

parasyte opened this issue Dec 19, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@parasyte
Copy link
Owner

This will officially support switching between Metric and US Standard measurement systems.

Here's a rough list of considerations:

  • Decide on a crate for conversions:
  • HTML parser needs to parse units in arbitrary strings, without knowing ahead of time which system is used.

These are the units I've personally observed so far:

  • Temperature
  • Length or volume
  • Weight
  • Force
  • Pressure
  • Combinations of the above, e.g. weight-per-volume

The HTML setup exports can use either measurement system. Some even include a mix of systems. For instance, Dallara P217 with US Standard mixes inches and millimeters:

<H2><U>LEFT FRONT:</U></H2>
Corner weight: <U>527 lbs</U><br>Ride height: <U>1.772 in</U><br>Shock defl: <U>1.070 in</U><br>of <U>1.969 in</U><br>Torsion bar defl: <U>0.377 in</U><br>Torsion bar turns: <U>5.000 Turns</U><br>Torsion bar O.D.: <U> 13.90 mm </U><br>LS comp damping: <U>2 clicks</U><br>HS comp damping: <U>5 clicks</U><br>HS comp damp slope: <U>4 clicks</U><br>LS rbd damping: <U>4 clicks</U><br>HS rbd damping: <U>6 clicks</U><br>Camber: <U>-2.8 deg</U><br><br>

Our parser needs to keep this in mind. There are a few approaches I will experiment with:

  1. RegEx-based parser.
  2. Heuristics-based parser.
  3. A combination of the two.

The RegEx parser is expected to have many ambiguities to resolve. The heuristics are expected to remain incomplete forever. And the combination might just end up being the best overall. (E.g. heuristics for known patterns, and RegEx for everything else.)

@parasyte parasyte added the enhancement New feature or request label Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant