From 1a96d382c8de3af9eb28a065d0407ad11151b911 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 26 Dec 2023 06:21:12 +0100 Subject: fix: fix tag-by-tag suggestion --- app/Main.hs | 7 +++++-- 1 file 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 -- cgit v1.2.3