duckling
duckling copied to clipboard
Bugs in *from*/ *to* context
Hi,
Are these bugs?
Now: Wednesday, 30 May 2018 at 17:53:17 -0700 (-07:00) :second
-
Query: From 3AM to 12 noon Produces just the 12:00 Result: Thursday, 31 May 2018 at 12:00:00 -0700 (-07:00) :hour
-
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
-
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
-
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.
Hi @a-k-s-h-a-y –
Thanks for your report.
-
I'm not sure about this one. @patapizza?
-
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.
-
Seems to be a bug.
-
Seems to be a bug.
Hi,
Are these bugs?
Now: Wednesday, 30 May 2018 at 17:53:17 -0700 (-07:00) :second
- Query: From 3AM to 12 noon Produces just the 12:00 Result: Thursday, 31 May 2018 at 12:00:00 -0700 (-07:00) :hour
- 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
- 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
- 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