Clarification and motivation
At the moment, the parser only recognizes time references if:
- they're immediately at the beginning of the message: "9am"
- or after a space: "I can't go today, let's try 9am tomorrow instead"
This is implemented here:
|
-- time reference can be either at the beginning or after a space |
|
. (Whitespace :) |
|
-- no space here before `timeRefGroupParser` requires a space before the contents |
|
secondGroup <- timeRefGroupParser |
The rationale is to avoid parsing things like "The product ID is AEH9AM" as "9AM".
However, there can be situations where a legitimate time reference is not actually preceded by a space:
>>> parseTimeRefs "How about Mike's suggestion (9am tomorrow)?"
[]
We should be able to parse these.
Clarification and motivation
At the moment, the parser only recognizes time references if:
This is implemented here:
tzbot/src/TzBot/Parser.hs
Lines 274 to 275 in 0f58a50
tzbot/src/TzBot/Parser.hs
Line 445 in 0f58a50
tzbot/src/TzBot/Parser.hs
Lines 339 to 340 in 0f58a50
The rationale is to avoid parsing things like "The product ID is AEH9AM" as "9AM".
However, there can be situations where a legitimate time reference is not actually preceded by a space:
We should be able to parse these.