Recognizers-Text icon indicating copy to clipboard operation
Recognizers-Text copied to clipboard

[EN Number] Issue with fracLikeNumberParse in JavaScript

Open hershkoy opened this issue 4 years ago • 1 comments

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

hershkoy avatar Sep 17 '21 15:09 hershkoy

"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.

tellarin avatar Dec 31 '21 07:12 tellarin