summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2023-12-26 06:21:12 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2023-12-26 06:21:36 +0100
commit1a96d382c8de3af9eb28a065d0407ad11151b911 (patch)
tree4acca3dea50eea9cdcd249127a17c2b78bc405bf /app
parent7b30bdd8763da0c8e9dd5c9464f9aca0a8d000ed (diff)
fix: fix tag-by-tag suggestion
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 156af1d..5eb661d 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -252,8 +252,8 @@ main = do
keep
)
(map (cwd </>) inputs)
- allDocs <- getDocuments
docs <- mapM (readDocument . (<.> "json")) indexNames
+ allDocs <- getDocuments
docs' <-
if prompt
then processDocumentsInteractively settings allDocs docs
@@ -480,7 +480,10 @@ suggestTags settings allDocs doc = do
]
let tagValues =
probabilityMap
- & filter (\(word, tag, _) -> hasWordAndTag word tag doc)
+ & filter
+ ( \(word, tag, _) ->
+ tagKey tag == tagName && hasWord word doc
+ )
& foldl'
( \scorePerTagValue (_, tag, p) ->
M.insertWith