Skip to content

Commit 71dcc80

Browse files
authored
Update search_engine.py
1 parent 94cafc8 commit 71dcc80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

search_engine/search_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def preprocess(text):
9-
return re.sub(r'[^\w\s]', '', text).lower()
9+
return re.sub(r'[^\w\s]|(?<!\w)_', '', text).lower()
1010

1111

1212
def search(docs: list, words: str) -> list:
@@ -110,4 +110,4 @@ def get_tf_idf(docs):
110110
# {'id': 'doc3', 'text': doc3},
111111
# ]
112112

113-
# pprint(get_tf_idf(docs))
113+
# pprint(get_tf_idf(docs))

0 commit comments

Comments
 (0)