diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-12-26 05:39:29 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-12-26 05:39:30 +0100 |
commit | 4089b57dda84ce907046c7d47c44f75711310e23 (patch) | |
tree | f00edf04967cdc1dc188f4f35dcc54ca0a4c544c /app/Settings.hs | |
parent | 97d2eb5a52d546db79ac687479f2d687de8445c1 (diff) |
chore: add `SuggestTagByTags`
This naive implementation scores tags based on the words that correlate
to a tag being set. It then uses that score to determine the
highest-scoring value for a tag based on the words in a document.
Diffstat (limited to 'app/Settings.hs')
-rw-r--r-- | app/Settings.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Settings.hs b/app/Settings.hs index 5d4d55f..39e8e35 100644 --- a/app/Settings.hs +++ b/app/Settings.hs @@ -43,7 +43,8 @@ instance Monoid Settings where -- -- - date formats that spell out the month name, ie. `1 Januar 1970` or `1 Jan 1970` -- - perform minor corrections on OCR, ie. parse `0 1.01.1970` - SuggestTagByRE "createdAt" [R.re|[0-9]{2}\.[0-9]{2}\.[0-9]{4}|] + SuggestTagByRE "createdAt" [R.re|[0-9]{2}\.[0-9]{2}\.[0-9]{4}|], + SuggestTagByTags "correspondent" ] } @@ -53,6 +54,7 @@ instance A.ToJSON Settings data SuggestedTag = SuggestTagByRE T.Text R.RE + | SuggestTagByTags T.Text deriving (Show, Generic, Eq) instance Show R.RE where |