Rename the corresponding variable to be more explicit

This commit is contained in:
Tissevert 2024-03-16 15:46:37 +01:00
parent 8eae217d17
commit f2caf77510

View file

@ -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):