kertser commited on
Commit
4e54373
1 Parent(s): 9e46021

Upload WarOnline_Chat.py

Browse files
Files changed (1) hide show
  1. 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 = re.sub(",+", ",", S)
29
- S = re.sub("!.", "!", S)
30
- S = re.sub(".?", "?", S)
31
- S = re.sub(",!", "!", S)
32
- S = re.sub(",.", ",", S)
33
- S = re.sub(".]", ".", S)
34
- S = re.sub(",\)", ")", S)
35
- S = re.sub("&", "", S)
36
- S = re.sub("&", "", S)
37
- S = re.sub("ен,ицхак", "ен-ицхак", 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