facebook / facebook/duckling

"before the end of the month" incorrectly parsed

Open
#275 5 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Haskell
Stars
4.3k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

Currently a phrase like "before the end of the month" gives an interval as expected, but the end date is not the last day of the month.

Examples:
```
curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_US&text=before the end of the month'
[
{
"body": "before the end of the month",
"dim": "time",
"end": 27,
"latent": false,
"start": 0,
"value": {
"to": {
"grain": "day",
"value": "2018-11-21T00:00:00.000-08:00"
},
"type": "interval",
"values": [
{
"to": {
"grain": "day",
"value": "2018-11-21T00:00:00.000-08:00"
},
"type": "interval"
}
]
}
}
]
```

```
curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_US&text=before end of dec'
[
{
"body": "before end of dec",
"dim": "time",
"end": 17,
"latent": false,
"start": 0,
"value": {
"to": {
"grain": "day",
"value": "2018-12-21T00:00:00.000-08:00"
},
"type": "interval",
"values": [
{
"to": {
"grain": "day",
"value": "2018-12-21T00:00:00.000-08:00"
},
"type": "interval"
},
{
"to": {
"grain": "day",
"value": "2019-12-21T00:00:00.000-08:00"
},
"type": "interval"
},
{
"to": {
"grain": "day",
"value": "2020-12-21T00:00:00.000-08:00"
},
"type": "interval"
}
]
}
}
]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.