Consider the following test case: de 14 a 16 hs ("from 14 to 16" in English). The output is as follows:
de <datetime> - <datetime> (interval) (de 14 a 16)
-- regex (de)
-- time-of-day (latent) (14)
-- -- integer (numeric) (14)
-- -- -- regex (14)
-- regex (a)
-- time-of-day (latent) (16)
-- -- integer (numeric) (16)
-- -- -- regex (16)
[Entity {dim = "time", body = "de 14 a 16", value = RVal Time (TimeValue (IntervalValue (InstantValue {vValue = 2013-02-12 14:00:00 -0200, vGrain = Hour},InstantValue {vValue = 2013-02-12 16:00:00 -0200, vGrain = Hour})) [IntervalValue (InstantValue {vValue = 2013-02-12 14:00:00 -0200, vGrain = Hour},InstantValue {vValue = 2013-02-12 16:00:00 -0200, vGrain = Hour}),IntervalValue (InstantValue {vValue = 2013-02-13 14:00:00 -0200, vGrain = Hour},InstantValue {vValue = 2013-02-13 16:00:00 -0200, vGrain = Hour}),IntervalValue (InstantValue {vValue = 2013-02-14 14:00:00 -0200, vGrain = Hour},InstantValue {vValue = 2013-02-14 16:00:00 -0200, vGrain = Hour})] Nothing), start = 0, end = 10, latent = False, enode = Node {nodeRange = Range 0 10, token = Token Time TimeData{latent=False, grain=Hour, form=Nothing, direction=Nothing, holiday=Nothing, hasTimezone=False}, children = [Node {nodeRange = Range 0 2, token = Token RegexMatch (GroupMatch []), children = [], rule = Nothing},Node {nodeRange = Range 3 5, token = Token Time TimeData{latent=True, grain=Hour, form=Just (TimeOfDay {hours = Just 14, is12H = False}), direction=Nothing, holiday=Nothing, hasTimezone=False}, children = [Node {nodeRange = Range 3 5, token = Token Numeral (NumeralData {value = 14.0, grain = Nothing, multipliable = False, okForAnyTime = True}), children = [Node {nodeRange = Range 3 5, token = Token RegexMatch (GroupMatch ["14"]), children = [], rule = Nothing}], rule = Just "integer (numeric)"}], rule = Just "time-of-day (latent)"},Node {nodeRange = Range 6 7, token = Token RegexMatch (GroupMatch []), children = [], rule = Nothing},Node {nodeRange = Range 8 10, token = Token Time TimeData{latent=True, grain=Hour, form=Just (TimeOfDay {hours = Just 16, is12H = False}), direction=Nothing, holiday=Nothing, hasTimezone=False}, children = [Node {nodeRange = Range 8 10, token = Token Numeral (NumeralData {value = 16.0, grain = Nothing, multipliable = False, okForAnyTime = True}), children = [Node {nodeRange = Range 8 10, token = Token RegexMatch (GroupMatch ["16"]), children = [], rule = Nothing}], rule = Just "integer (numeric)"}], rule = Just "time-of-day (latent)"}], rule = Just "de <datetime> - <datetime> (interval)"}}]
As you can see, the output is 14:00 - 16:00. The API states that the upper bound should be exclusive, that is 14:00 - 17:00. Other languages return the correct result (EN, DE, etc.) but not in Spanish. The cause is that the time interval is defined as "Open":
Consider the following test case:
de 14 a 16 hs
("from 14 to 16" in English). The output is as follows:As you can see, the output is
14:00 - 16:00
. The API states that the upper bound should be exclusive, that is14:00 - 17:00
. Other languages return the correct result (EN, DE, etc.) but not in Spanish. The cause is that the time interval is defined as "Open":https://github.com/facebook/duckling/blob/84175d61d6f44d0db2abb42d67c6c4213762b64f/Duckling/Time/ES/Rules.hs#L801-L814
For example, in English the interval is "Closed". This yields the correct result.
https://github.com/facebook/duckling/blob/84175d61d6f44d0db2abb42d67c6c4213762b64f/Duckling/Time/EN/Rules.hs#L1385-L1398
The fix requires changing the type of interval from "Open" to "Closed" and adjust the tests.