From f2caf77510a12d7e36195b931d4e6dcb2276dc21 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sat, 16 Mar 2024 15:46:37 +0100 Subject: [PATCH] Rename the corresponding variable to be more explicit --- memory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory.py b/memory.py index c681c9b..5281380 100644 --- a/memory.py +++ b/memory.py @@ -3,7 +3,7 @@ import json from math import sqrt import re -WORD_THRESHOLD = 4 +WORD_LENGTH_THRESHOLD = 4 class RowDecoder(json.JSONDecoder): def decode(self, s): @@ -24,7 +24,7 @@ def index(text): words = re.split('\s', text) normalized_words = [keepOnlyAlphaChars(word) for word in words] important_words = set([w for w in normalized_words - if len(w) >= WORD_THRESHOLD]) + if len(w) >= WORD_LENGTH_THRESHOLD]) return important_words def insert(db, row):