Update appChatbot.py
Browse files- appChatbot.py +2 -0
appChatbot.py
CHANGED
@@ -35,6 +35,8 @@ vectorstore = None
|
|
35 |
|
36 |
def replace_newlines_and_spaces(text):
|
37 |
# Replace all newline characters with spaces
|
|
|
|
|
38 |
text = text.replace("\n", " ")
|
39 |
# Replace multiple spaces with a single space
|
40 |
text = re.sub(r'\s+', ' ', text)
|
|
|
35 |
|
36 |
def replace_newlines_and_spaces(text):
|
37 |
# Replace all newline characters with spaces
|
38 |
+
text= text.replace('\t\r','') # tab, enter
|
39 |
+
text= text.replace('\xa0','') # non-breaki
|
40 |
text = text.replace("\n", " ")
|
41 |
# Replace multiple spaces with a single space
|
42 |
text = re.sub(r'\s+', ' ', text)
|