Upload WarOnline_Chat.py
Browse files- WarOnline_Chat.py +15 -11
WarOnline_Chat.py
CHANGED
@@ -25,16 +25,20 @@ session = requests.Session()
|
|
25 |
|
26 |
def fixString(S):
|
27 |
# This is a helper function to overcome the bugs of tokenizer
|
28 |
-
S =
|
29 |
-
S =
|
30 |
-
S =
|
31 |
-
S =
|
32 |
-
S =
|
33 |
-
S =
|
34 |
-
S =
|
35 |
-
S =
|
36 |
-
S =
|
37 |
-
S =
|
|
|
|
|
|
|
|
|
38 |
return S
|
39 |
|
40 |
def compare_pages(url1, url2):
|
@@ -226,7 +230,7 @@ def WarOnlineBot():
|
|
226 |
if originalQuote == "": # Just images, no text
|
227 |
continue
|
228 |
else:
|
229 |
-
quote = remove_non_english_russian_chars(msg['reply'])
|
230 |
|
231 |
message = ""
|
232 |
|
|
|
25 |
|
26 |
def fixString(S):
|
27 |
# This is a helper function to overcome the bugs of tokenizer
|
28 |
+
S = S.replace(",+", ",")
|
29 |
+
S = S.replace("!.", "!")
|
30 |
+
S = S.replace(".?", "?")
|
31 |
+
S = S.replace("?.", "?")
|
32 |
+
S = S.replace(",!", "!")
|
33 |
+
S = S.replace(",.", ",")
|
34 |
+
S = S.replace(".]", ".")
|
35 |
+
S = S.replace(",\)", ")")
|
36 |
+
S = S.replace("&", "")
|
37 |
+
S = S.replace("&", "")
|
38 |
+
S = S.replace("ен,ицхак", "ен-ицхак")
|
39 |
+
S = S.replace("(,", "(")
|
40 |
+
S = S.replace("?.", "?")
|
41 |
+
S = S.replace("#","")
|
42 |
return S
|
43 |
|
44 |
def compare_pages(url1, url2):
|
|
|
230 |
if originalQuote == "": # Just images, no text
|
231 |
continue
|
232 |
else:
|
233 |
+
quote = remove_non_english_russian_chars(msg['reply']).strip()
|
234 |
|
235 |
message = ""
|
236 |
|