Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[* Currency] Error recognizing currency range #3071

Open
lanz0519 opened this issue Feb 1, 2023 · 0 comments
Open

[* Currency] Error recognizing currency range #3071

lanz0519 opened this issue Feb 1, 2023 · 0 comments

Comments

@lanz0519
Copy link

lanz0519 commented Feb 1, 2023

Describe the bug
Regarding the problem of RecognizeCurrency, we used to use the java version, this problem does not exist, but after switching to the c# version found this problem. The problem is that there are some problems with recognizing statements that contain '-' or 'to', whether it is currency or other custom units.

To Reproduce
For the same phrase "15-20 usd"

Return value of java version:

[
    {
        "text": "20 usd",
        "start": 3,
        "end": 8,
        "typeName": "currency",
        "resolution": {
            "isoCurrency": "USD",
            "unit": "United States dollar",
            "value": "20"
        }
    }
]

Return value of .net version
[]
Yes, there is no value
For the other case"15 -20 usd"
Return value of java version:

[
    {
        "text": "20 usd",
        "start": 4,
        "end": 9,
        "typeName": "currency",
        "resolution": {
            "isoCurrency": "USD",
            "unit": "United States dollar",
            "value": "20"
        }
    }
]

Return value of .net version:

[
    {
        "text": "20 usd",
        "start": 4,
        "end": 9,
        "typeName": "currency",
        "resolution": {
            "isoCurrency": "USD",
            "unit": "United States dollar",
            "value": "20"
        }
    }
]

At this time the return value of the .net version is normal again, after testing found that adding spaces before and after '-' or 'to' will make the final recognition result as expected

Expected behavior
We want the .net version to recognize the phrase "15-20 usd" with the message 20 usd, not just two numbers

Platform (please complete the following information):

  • Platform: .NET
  • Environment: nuget package
  • Version of package latest
@tellarin tellarin changed the title currency recognize error [* Currency] Error recognizing currency range Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants