Recognizers-Text
Recognizers-Text copied to clipboard
[EN Number] Issue with fracLikeNumberParse in JavaScript
Describe the bug In English Number, I tried to parse the sentence: "two out of five hundred tvs". The result I expected was 2/500=0.004. But see below, it doesn't work.
To Reproduce Steps to reproduce the behavior: Add this case to
{
"Input": "two out of five hundred tvs",
"Results": [
{
"Text": "two out of five hundred",
"TypeName": "number",
"Resolution": {
"subtype": "fraction",
"value": "0.004"
},
"Start": 0,
"End": 22
}
]
},
Run:
>ava --match='*tvs*'
Result is:
index-number » Number - English - NumberModel - "two out of five hundred tvs"
Result.Resolution.value
Difference:
- 'INFINITY'
+ '0.004'
Expected behavior It should pass the test
"two out of five hundred tvs" work in .NET. But weirdly "two out of five hundreds tvs" produces wrong results. @aitelint Can you take a quick look? At least the incorrect sentence shouldn't produce such incorrect results in .NET.