From 4089b57dda84ce907046c7d47c44f75711310e23 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 26 Dec 2023 05:39:29 +0100 Subject: 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. --- app/Settings.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/Settings.hs') 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 -- cgit v1.2.3