duckling_old
duckling_old copied to clipboard
23rd of next month does not get recognized
Hi,
Would be great if you could also handle a phrase like: "23 of next month"
Currently it understands it as the first of the next month
May just need some fiddling with the rules. Search <day-of-moth>
in resources/languages/en/rules/time.clj
. For what it's worth, "the 23rd of next month" works out-of-the-box:
duckling.core=> (load! {:config {:en$time {:corpus ["numbers" "time"] :rules ["cycles" "duration" "numbers" "time"]}}})
{:en$time (:number :time :ordinal :cycle :unit-of-duration :duration :timezone)}
duckling.core=> (play :en$time "the 23rd of next month" [:time] (default-context :now))
W ---------------------- 12 | time | intersect by "of", "from", "'s" | P = -8.4524 | the <day-of-month> (
-- 11 | null | number (as relative minutes) | P = -1.0987 | integer (numeric)
-- 10 | time | time-of-day (latent) | P = -0.7685 | integer (numeric)
------ 9 | time | the <day-of-month> (non ordinal) | P = -0.1360 | + integer (numeric)
---- 8 | time | <day-of-month> (ordinal) | P = -0.7397 | ordinal (digits)
-------- 7 | time | the <day-of-month> (ordinal) | P = -0.0465 | + ordinal (digits)
-- 6 | time | year (latent) | P = -1.1775 | integer (numeric)
---------- 5 | time | next <cycle> | P = -1.5404 | + month (cycle)
---- 4 | ordinal | ordinal (digits) | P = -0.0465 |
-- 3 | number | integer (numeric) | P = -0.1360 |
----- 2 | unit-of-duration | month (unit-of-duration) | P = 0.0000 |
----- 1 | cycle | month (cycle) | P = 0.0000 |
the 23rd of next month
1 winners:
time {:type "value", :value "2017-04-23T00:00:00.000-07:00", :grain :day, :values ({:type "value", :value "2017-04-23T00:00:00.000-07:00", :grain :day})} {:label :time, :direction nil}