From 70aceab622c351c175ceddbdde52f9d98dcd71f1 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 4 Oct 2019 15:14:43 +0100 Subject: [PATCH] exclude lines with URLs in them from creating markov chains closes #156 --- modules/markov.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/markov.py b/modules/markov.py index d88c2d37..f2c3b6c4 100644 --- a/modules/markov.py +++ b/modules/markov.py @@ -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)