diff --git a/markov.py b/markov.py index 7db2f3a..dff8d8f 100755 --- a/markov.py +++ b/markov.py @@ -19,7 +19,7 @@ def sanitizeText(text): if text[0] == "@" or text[1] == "@": if split[1][0] not in string.ascii_lowercase: return sanitizeText(" ".join(split[1:])) - if split[-1][0] == "@" and text[-1] in (string.ascii_letters + "_"): + if split[-1][0] == "@" and text[-1] in (string.digits + string.ascii_letters + "_"): return sanitizeText(" ".join(split[:-1])) if text[:4] == "RT @": return sanitizeText(text.partition(":")[2])