nielstron / quantulum3

Library for unit extraction - fork of quantulum for python3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More complicated area and volume

l2silver opened this issue · comments

Is your feature request related to a problem? Please describe.
Trying to grab the dimensions of a pan, 16 x 18 inch. Should return area, but instead returns 16 dimensionless and 18 inch

Describe the solution you'd like
Something simple that could work would be to return

[Quantity(16, "Unit(name="inch", entity=Entity("partialArea"), uri=Inch)"),
Quantity(18, "Unit(name="inch", entity=Entity("partialArea"), uri=Inch)")]

Describe alternatives you've considered
None. Maybe this has already been solved? Not sure.

Additional context
I'm happy to attempt this. Is this feasible?

This sounds like a really cool feature! It is certainly not included in the current feature set yet.

Something simple that could work would be to return

My point point would be to keep the two numbers as close as possible, preferrably in one Object (this makes further processing easier).

Then either combine the values (however not really preserving the original meaning)

[Quantity(288, "Unit(name="square inch", entity=Entity("length"), uri=Inch)")]

Or create a new type of entity class or extension similar to the "uncertainty" extension.

[QuantityTuple(16, 18, "Unit(name="inch", entity=Entity("length"), uri=Inch)")]

Is this feasible?

I can't really tell how difficult this will be. Maybe first try to have a look at the uncertainty extension and get a grasp on the overall flow of the package. Suggestions forchanges are welcome as well. And maybe for a starter, the simple case of "Q x Q" might suffice to be handled. I am not really aware of other ways to write the same meaning.

Thanks Nielstron, I'll take a crack at it and see what happens