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

[EN] Grain of <duration> ago #222

Open
almostimplemented opened this issue Feb 23, 2017 · 0 comments
Open

[EN] Grain of <duration> ago #222

almostimplemented opened this issue Feb 23, 2017 · 0 comments

Comments

@almostimplemented
Copy link
Contributor

When people say "in two days" or "three days ago", they typically are referring to the whole day. Currently, duckling.time.prod/duration-ago and /in-duration (typically) change the grain to be one below (finer than) the grain of the duration. I think the semantics are slightly trickier than this.

I would contend most of the time, these two utterances should have equivalent meaning:

duckling.core=> (parse :en$core "the day before yesterday" [:time])
({:dim :time, :body "the day before yesterday", :value {:type "value", :value "2017-02-20T00:00:00.000-08:00", :grain :day, :values ()}, :start 0, :end 24})
duckling.core=> (parse :en$core "two days ago" [:time])
({:dim :time, :body "two days ago", :value {:type "value", :value "2017-02-20T16:00:00.000-08:00", :grain :hour, :values ()}, :start 0, :end 12})

When the duration grain is :hour, I think refining the grain to :minute makes good sense ... Saying "in two hours" at 1:30 usually means 3:30. However, if the duration is :minute, I'm not sure it makes sense to change the grain. If I say "in an hour and a half", I'm not making a to-the-second specification.

Another instance where refining the grain makes sense is "a week ago" and "a month ago", refining to :day (as is currently the case).

Thoughts? I guess my only real qualms are going from :day to :hour and from :minute to :second, and the former is the only one I feel strongly about.

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