You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to add a new rule for the time dimension in english language.
It is for parsing dates in the format 28-July-1999
I added the following new rule and its working fine.
ruleDOMMonthYear::Rule
ruleDOMMonthYear =Rule
{ name ="<day-of-month> (ordinal or number) <named-month> year"
, pattern=
[ Predicate isDOMValue
, Predicate isAMonth
, regex "(\\d{2,4})"
]
, prod =\tokens ->case tokens of
(token:TokenTime td:TokenRegexMatch (GroupMatch (match:_)):_) ->do
intVal <- parseInt match
dom <- intersectDOM td token
TokenTime<$> intersect dom (year intVal)
_ ->Nothing
}
However, when I run tests, I see that Aug 8 - Aug 16 fails. Here is the debug log.
*Duckling.Debug> debug EN "Aug 8 - Aug 12" [This Time]
intersect (Aug 8 - Aug 12)
-- August (Aug)
-- -- regex (Aug)
-- <day-of-month> (ordinal or number) <named-month> year (8 - Aug 12)
-- -- integer (numeric) (8)
-- -- -- regex (8)
-- -- August (Aug)
-- -- -- regex (Aug)
-- -- regex (12)
[Entity {dim = "time", body = "Aug 8 - Aug 12", value = "{\"values\":[],\"value\":\"2012-08-08T00:00:00.000-02:00\",\"grain\":\"day\",\"type\":\"value\"}", start = 0, end = 14}]
Is there any way to fix it?
The text was updated successfully, but these errors were encountered:
Hi,
I wanted to add a new rule for the time dimension in english language.
It is for parsing dates in the format
28-July-1999
I added the following new rule and its working fine.
However, when I run tests, I see that
Aug 8 - Aug 16
fails. Here is the debug log.Is there any way to fix it?
The text was updated successfully, but these errors were encountered: