summaryrefslogtreecommitdiffstats
path: root/app/Settings.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2023-12-26 06:03:31 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2023-12-26 06:03:31 +0100
commit7b30bdd8763da0c8e9dd5c9464f9aca0a8d000ed (patch)
treee1c803e5cf5c787f19fd8e2df53d87422315c32e /app/Settings.hs
parentf83bec1d304250b0af5a7fba60770d7250d05eea (diff)
chore: add `--language`
Diffstat (limited to 'app/Settings.hs')
-rw-r--r--app/Settings.hs9
1 files changed, 6 insertions, 3 deletions
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