exclude lines with URLs in them from creating markov chains

closes #156
This commit is contained in:
jesopo 2019-10-04 15:14:43 +01:00
parent b2473a4ac4
commit 70aceab622

View file

@ -53,6 +53,9 @@ class Module(ModuleManager.BaseModule):
return lambda: self._create(channel_id, line)
def _create(self, channel_id, line):
if utils.http.REGEX_URL.search(line):
return
words = list(filter(None, line.split(" ")))
words = [word.lower() for word in words]
words_n = len(words)