Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

How can I force dates/times to be in the past #192

Open
dyladan opened this issue Nov 29, 2016 · 0 comments
Open

How can I force dates/times to be in the past #192

dyladan opened this issue Nov 29, 2016 · 0 comments

Comments

@dyladan
Copy link
Contributor

dyladan commented Nov 29, 2016

I'm sorry if this is an inappropriate place to ask this question but I didn't know where else to go.

I have an application that takes natural date and time queries and needs to assume that they happened in the past; rather than in the future, as duckling does. Right now this is my (very hacky) solution:

(p/parse :en$core exp [:time] context)
; if that result is in the future
(p/parse :en$core (str "last " exp) [:time] context)

This changes:

blah blah thursday blah

which returns the first thursday in the future, into:

blah blah last thursday blah

which returns Thursday in the past. Is there a better/supported way to do this?

@dyladan dyladan changed the title Force dates/times to be in the past How can I force dates/times to be in the past Dec 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant