-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#82] Remind time contexts and apply to time references
Problem: Sometimes, context of a time reference can be spread over one sentence, several different sentences or even several different messages. Solution: Parse contexts alone, remind them and apply to context-free time references when encountered; track a context during thread evolution.
- Loading branch information
1 parent
5950cd5
commit ec5c7ca
Showing
8 changed files
with
256 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
-- SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io/> | ||
-- | ||
-- SPDX-License-Identifier: MPL-2.0 | ||
|
||
module TzBot.TimeContext where | ||
|
||
import Universum hiding (many, toList, try) | ||
|
||
import Control.Lens.TH (makeLensesWith) | ||
import TzBot.Instances () | ||
import TzBot.TimeReference | ||
import TzBot.Util | ||
|
||
data TimeContext = TimeContext | ||
{ tcCurrentDateRef :: Maybe DateReference | ||
, tcCurrentLocRef :: Maybe LocationReference | ||
} deriving stock (Show, Eq, Generic) | ||
|
||
emptyTimeContext :: TimeContext | ||
emptyTimeContext = TimeContext Nothing Nothing | ||
|
||
makeLensesWith postfixFields ''TimeContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters