facebook / duckling

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.
Other
4.05k stars 720 forks source link

[EN/BG/TR] "from Monday to Sunday" /= "all week" #659

Open emlautarom1 opened 2 years ago

emlautarom1 commented 2 years ago

When we say "all week" I assume that it's the same as if we said "from Monday to Sunday", yet in Duckling this represents a different time interval:

This looks like a bug, but maybe it's intentional? All 3 languages use a very similar rule:

https://github.com/facebook/duckling/blob/84175d61d6f44d0db2abb42d67c6c4213762b64f/Duckling/Time/EN/Rules.hs#L1121-L1139

If we change -2 to -1 then both inputs return the same interval - "Start of Monday until the start of the next Monday" - which I think is the correct output.

https://github.com/facebook/duckling/blob/84175d61d6f44d0db2abb42d67c6c4213762b64f/Duckling/Time/EN/Rules.hs#L1129

What's the meaning of that line? there are several magic numbers and the intention is not very clear, IMHO