From 003c8b85670c4130e9e86c3f16f290e46fcc76f0 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Thu, 23 Feb 2017 16:10:14 +0100 Subject: [PATCH] Shorter, possibly more efficient but who cares anyway --- markov.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markov.py b/markov.py index 9788f54..eed84f0 100755 --- a/markov.py +++ b/markov.py @@ -18,7 +18,7 @@ def sanitizeText(text): try: if "@" in (text[0], text[1]): if split[1][0] not in string.ascii_lowercase: - return sanitizeText(text.partition(" ")[2]) + return sanitizeText(" ".join(split[1:])) if split[-1][0] == "@": return sanitizeText(" ".join(split[:-1])) if text[:4] == "RT @":