Shorter, possibly more efficient but who cares anyway

This commit is contained in:
Klaus-Uwe Mitterer 2017-02-23 16:10:14 +01:00
parent 5d33a4392c
commit 003c8b8567

View file

@ -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 @":