nielstron / quantulum3

Library for unit extraction - fork of quantulum for python3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Operator x is parsed as a unit

s2u7 opened this issue · comments

commented

Describe the bug
Noticed that x operator in area dimension is parsed as a unit. Is there a way to exclude certain characters from being parsed as units.

To Reproduce
Steps to reproduce the behavior:

import quantulum3
from quantumlum3 import parser
quants = parser.parse('18 1/4 x 4 1/4  Floor Edge')
quants[0].surface

Expected behavior
'18 1/4'
** Actual behavior**
'18 1/4 x'

Screenshots
If applicable, add screenshots to help explain your problem.

Additional information:

  • Python Version: [3.8]
  • Classifier activated/ sklearn installed: [yes?]
  • OS: [Linus]
  • Version [20.0.4]

Additional context
Add any other context about the problem here.

Is there a way to exclude certain characters from being parsed as units.

No unfortunately there is currently no way to do this.

When trying to run this, I get the following output:

[Quantity(18.25, "Unit(name="dimensionless", entity=Entity("dimensionless"), uri=Dimensionless_quantity)"), Quantity(4.25, "Unit(name="dimensionless", entity=Entity("dimensionless"), uri=Dimensionless_quantity)")]

which seems right to me?