facebook / duckling

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.
Other
4.05k stars 720 forks source link

Lack of parsing numbers with digit groups separated by ’ #651

Open belamenso opened 3 years ago

belamenso commented 3 years ago

Offending examples: 16’157, 815'300

  1. Command:

    curl -XPOST http://0.0.0.0:8000/parse --data 'locale=fr_CH&text="16’157"'

    Result (lacking an answer recognizing the number 16157):

    [
    {
      "body":"16",
      "start":1,
      "value":{
         "value":16,
         "type":"value"
      },
      "end":3,
      "dim":"number",
      "latent":false
    },
    {
      "body":"157\"",
      "start":4,
      "value":{
         "second":157,
         "value":157,
         "type":"value",
         "unit":"second",
         "normalized":{
            "value":157,
            "unit":"second"
         }
      },
      "end":8,
      "dim":"duration",
      "latent":false
    }
    ]
  2. Command:

    curl -XPOST http://0.0.0.0:8000/parse --data 'locale=fr_CH&text="815\'300"'

    Result (lacking an answer recognizing the number 815300):

    [
    {
      "body":"815'",
      "start":1,
      "value":{
         "value":815,
         "type":"value",
         "minute":815,
         "unit":"minute",
         "normalized":{
            "value":48900,
            "unit":"second"
         }
      },
      "end":5,
      "dim":"duration",
      "latent":false
    },
    {
      "body":"300\"",
      "start":5,
      "value":{
         "second":300,
         "value":300,
         "type":"value",
         "unit":"second",
         "normalized":{
            "value":300,
            "unit":"second"
         }
      },
      "end":9,
      "dim":"duration",
      "latent":false
    }
    ]