mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Put entry splitting regex in explicit filter into a variable for code readability
This commit is contained in:
@@ -15,11 +15,11 @@ def explicit_filter(raw_query, entries, embeddings):
|
||||
return query, entries, embeddings
|
||||
|
||||
# convert each entry to a set of words
|
||||
# split on fullstop, comma, colon, tab, newline or any brackets
|
||||
entry_splitter = r',|\.| |\]|\[\(|\)|\{|\}|\t|\n|\:'
|
||||
entries_by_word_set = [set(word.lower()
|
||||
for word
|
||||
in re.split(
|
||||
r',|\.| |\]|\[\(|\)|\{|\}|\t|\n|\:', # split on fullstop, comma or any brackets
|
||||
entry[1])
|
||||
in re.split(entry_splitter, entry[1])
|
||||
if word != "")
|
||||
for entry in entries]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user