From b9066f0933341c577011ea612bb0da9f3be9ff95 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sat, 16 Mar 2024 15:48:28 +0100 Subject: [PATCH] Turn indexed words lowercase to gain flexibility (to be restored when we have a real indexation mechanism) --- memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory.py b/memory.py index 5281380..b5989da 100644 --- a/memory.py +++ b/memory.py @@ -22,7 +22,7 @@ def keepOnlyAlphaChars(word): def index(text): words = re.split('\s', text) - normalized_words = [keepOnlyAlphaChars(word) for word in words] + normalized_words = [keepOnlyAlphaChars(word).lower() for word in words] important_words = set([w for w in normalized_words if len(w) >= WORD_LENGTH_THRESHOLD]) return important_words