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

[EN NumberRange] "smaller 20" interpreted wrongly

Open gooooloo opened this issue 3 years ago • 3 comments

Describe the bug "greater than 10 and smaller 20" is recognized as (10,20], but expected result is (10,20) in English language.

To Reproduce Add this test case to Specs\Number\English\NumberRangeModelExperimentalMode.json and run:

  {
    "Input": "greater than 10 and smaller 20",
    "NotSupported": "javascript, python",
    "Results": [
      {
        "Text": "greater than 10 and smaller 20",
        "Start": 0,
        "End": 29,
        "TypeName": "numberrange",
        "Resolution": {
          "value": "(10,20)"
        }
      }
    ]
  }

The test case fails. The actual Resolution value is (10,20]

Expected behavior The test case should pass.

Platform (please complete the following information):

  • Platform: .NET
  • Environment: source code, commit #fdee90fae3ceac501a11b13650a3da472bc9e53a

Additional context Result for "greater than 10 and smaller than 20" is correct. The LessOrEqualSuffix regex {((and|or)\s+(less|lower|smaller|fewer)((?!\s+than)|(\s+than(?!(\s*\d+)))))} doesn't cover "and smaller 20".

gooooloo avatar Jan 10 '22 07:01 gooooloo

"smaller 20" doesn't make sense in English. The error here is that it should not return anything. Only for "greater than 10". "greater than 10 and smaller than 20" works correctly.

tellarin avatar Jan 10 '22 08:01 tellarin

@tellarin Thanks for clarifying. Shall I close the issue or keep it open( in case you want to look into the "should not return anything" thing)? Please feel free to close it if you would like to.

gooooloo avatar Jan 11 '22 00:01 gooooloo

@gooooloo Let's leave the issue. It's tagged as low priority for now. Thanks.

tellarin avatar Jan 11 '22 03:01 tellarin