nielstron / quantulum3

Library for unit extraction - fork of quantulum for python3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"a mix" misunderstood as a singular mile.

EdwardChamberlain opened this issue · comments

commented

Describe the bug
When parsing the string " a mix " it is misunderstood as a singular mile.

To Reproduce
Steps to reproduce the behavior:

from quantulum3 import parser

s = "Its a mix"

print(parser.inline_parse(s))
Its a mix {one mile}

Expected behavior
Not to read mix as mile

Additional information:

  • Python Version: 3.8
  • Classifier activated/ sklearn installed: Yes
  • OS: Linux
  • Version 0.7.3

Thanks for pointing out this issue! The error here is that "x" is interpreted as multiplication operator and for now, it was never made sure that a unit cannot end with multiplication or division operator (while it can very well end with an power 2 operator or similar)