duckling icon indicating copy to clipboard operation
duckling copied to clipboard

Bugs in *from*/ *to* context

Open FR46M3N7-P4R71CL3 opened this issue 7 years ago • 2 comments

Hi,

Are these bugs?

Now: Wednesday, 30 May 2018 at 17:53:17 -0700 (-07:00) :second

  1. Query: From 3AM to 12 noon Produces just the 12:00 Result: Thursday, 31 May 2018 at 12:00:00 -0700 (-07:00) :hour

  2. Query: From 10AM to 1PM (From [hour1] to [hour2]) Hour2 seems to be +1'd every time. Result: From Thursday, 31 May 2018 at 10:00:00 -0700 (-07:00) to Thursday, 31 May 2018 at 14:00:00 -0700 (-07:00) :hour

  3. Query: 5 in the evening Shouldn't it just return the time (and not an interval)? The date too seems to be off. Result: From Saturday, 1 January 2005 at 18:00:00 -0800 (-08:00) to Sunday, 2 January 2005 at 0:00:00 -0800 (-08:00) :hour

  4. Query: 1 hour before 3 (or) 1 hour before 2 (or) 1 hour before -5 ? Result: Tuesday, 31 December 2002 at 23:00:00 -0800 (-08:00) :minute

Regards.

FR46M3N7-P4R71CL3 avatar May 30 '18 12:05 FR46M3N7-P4R71CL3

Hi @a-k-s-h-a-y –

Thanks for your report.

  1. I'm not sure about this one. @patapizza?

  2. C.f. https://github.com/facebook/duckling/issues/178 and other related issues: Duckling returns an exclusive upper limit for time intervals, so this is expected.

  3. Seems to be a bug.

  4. Seems to be a bug.

beauby avatar Jun 05 '18 12:06 beauby

Hi,

Are these bugs?

Now: Wednesday, 30 May 2018 at 17:53:17 -0700 (-07:00) :second

  1. Query: From 3AM to 12 noon Produces just the 12:00 Result: Thursday, 31 May 2018 at 12:00:00 -0700 (-07:00) :hour
  2. Query: From 10AM to 1PM (From [hour1] to [hour2]) Hour2 seems to be +1'd every time. Result: From Thursday, 31 May 2018 at 10:00:00 -0700 (-07:00) to Thursday, 31 May 2018 at 14:00:00 -0700 (-07:00) :hour
  3. Query: 5 in the evening Shouldn't it just return the time (and not an interval)? The date too seems to be off. Result: From Saturday, 1 January 2005 at 18:00:00 -0800 (-08:00) to Sunday, 2 January 2005 at 0:00:00 -0800 (-08:00) :hour
  4. Query: 1 hour before 3 (or) 1 hour before 2 (or) 1 hour before -5 ? Result: Tuesday, 31 December 2002 at 23:00:00 -0800 (-08:00) :minute

Regards.

1 is a bug, still exists in master 2 is because of what @beauby said, and is not a bug 3 is a bug (matches "5 in" as distance and "in the evening" as a time interval, meaning there's no rule for "X in the evening"):

[
  {
    "body": "5 in",
    "start": 1,
    "value": {
      "value": 5,
      "type": "value",
      "unit": "inch"
    },
    "end": 5,
    "dim": "distance",
    "latent": false
  },
  {
    "body": "in the evening",
    "start": 3,
    "value": {
      "values": [
        {
          "to": {
            "value": "2021-06-17T00:00:00.000-07:00",
            "grain": "hour"
          },
          "from": {
            "value": "2021-06-16T18:00:00.000-07:00",
            "grain": "hour"
          },
          "type": "interval"
        },
        {
          "to": {
            "value": "2021-06-18T00:00:00.000-07:00",
            "grain": "hour"
          },
          "from": {
            "value": "2021-06-17T18:00:00.000-07:00",
            "grain": "hour"
          },
          "type": "interval"
        },
        {
          "to": {
            "value": "2021-06-19T00:00:00.000-07:00",
            "grain": "hour"
          },
          "from": {
            "value": "2021-06-18T18:00:00.000-07:00",
            "grain": "hour"
          },
          "type": "interval"
        }
      ],
      "to": {
        "value": "2021-06-17T00:00:00.000-07:00",
        "grain": "hour"
      },
      "from": {
        "value": "2021-06-16T18:00:00.000-07:00",
        "grain": "hour"
      },
      "type": "interval"
    },
    "end": 17,
    "dim": "time",
    "latent": false
  }
]

4 is a bug, but is fixed in master

chessai avatar Jun 16 '21 19:06 chessai