From 7b30bdd8763da0c8e9dd5c9464f9aca0a8d000ed Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 26 Dec 2023 06:03:31 +0100 Subject: chore: add `--language` --- app/Settings.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'app/Settings.hs') diff --git a/app/Settings.hs b/app/Settings.hs index 39e8e35..f4c5811 100644 --- a/app/Settings.hs +++ b/app/Settings.hs @@ -23,14 +23,16 @@ import System.Environment.XDG.BaseDir (getSystemConfigFiles, getUserConfigFile) import Text.RE.TDFA.Text qualified as R data Settings = Settings - { suggestedTags :: [SuggestedTag] + { suggestedTags :: [SuggestedTag], + defaultLanguage :: String } deriving (Show, Generic) instance Semigroup Settings where a <> b = Settings - { suggestedTags = nub (a.suggestedTags <> b.suggestedTags) + { suggestedTags = nub (a.suggestedTags <> b.suggestedTags), + defaultLanguage = b.defaultLanguage } instance Monoid Settings where @@ -45,7 +47,8 @@ instance Monoid Settings where -- - perform minor corrections on OCR, ie. parse `0 1.01.1970` SuggestTagByRE "createdAt" [R.re|[0-9]{2}\.[0-9]{2}\.[0-9]{4}|], SuggestTagByTags "correspondent" - ] + ], + defaultLanguage = "deu+eng" } instance A.FromJSON Settings -- cgit v1.2.3