VisionEval / VisionEval-Dev

Development version of VisionEval framework
https://visioneval.github.io/
Apache License 2.0
6 stars 32 forks source link

Parse compound currency units (e.g. USD.2008/DAY); fixes #19 #167

Closed jrawbits closed 2 years ago

jrawbits commented 2 years ago

Addresses Issue #19 (Currency data can't be handled as a compound type)

The solution amounts to adjusting the UNIT and letting regular currency handling continue as usual (on the theory that a pile of cash is a pile of cash, regardless of whether it is per DAY, per PRSN or per anything else). Regular compound unit checking will proceed as usual (so the part after the "/" probably may need to be a known unit type).

When we are presented with a compound currency unit, it needs to look like USD.2010/DAY or if there is a Multiplier, it will be handled correctly if it looks either like USD.2010.1e3/DAY or USD.2010/DAY.1e3 (new code moves the /DAY part to the base currency unit.

USD.2008.1e3/DAY yields UNIT=USD/DAY, YEAR=2008, MULTIPLIER=1e3 USD.2008/DAY.1e3 also yields UNIT=USD/DAY, YEAR=2008, MULTIPLIER=1e3 USD.2008/DAY yields UNIT=USD/DAY, YEAR=2008, MULTIPLIER=NA

Happy to discuss and adjust further.