Fix bug that prevented Bogofilter from seeing OCR tokens

master
Thor 3 years ago
parent 8309c83e6a
commit fbec018fc1
  1. 3
      cringebot.py

@ -154,7 +154,6 @@ class CringeBotClient(BotClient):
target_mail_text = target_mail.format()
# TODO: Move status classification system to separate module for use in other bots
tokens = deque(command.split())
while True:
token = tokens.popleft()
@ -382,7 +381,7 @@ def toot_dict_to_mail(toot_dict):
#print("ocr_text =", ocr_text)
words = [match[0] for match in filter(lambda match: len(match[1]) > 0, re.findall(TOKEN, ocr_text))]
#print("words =", words)
tokens = ["ocr`" + word.lower() for word in words]
tokens = ["ocr-" + word.lower() for word in words]
#print("tokens =", tokens)
body += "\n\n" + " ".join(tokens)
except Exception:

Loading…
Cancel
Save