From 4d20f602a77c40d1e81d5f91c87e52d00e90c876 Mon Sep 17 00:00:00 2001 From: xfnw Date: Thu, 10 Mar 2022 09:43:40 -0700 Subject: [PATCH] tokenize punctuation before recording words --- modules/nlp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nlp.py b/modules/nlp.py index 3cf897d..515c983 100644 --- a/modules/nlp.py +++ b/modules/nlp.py @@ -19,7 +19,7 @@ async def rec(self, m): beg = shared.db["beg"] end = shared.db["end"] - words = m.split() + words = re.sub(r"([\.,\?!])", r" \1", m).split() if words[0] == "admin" or len(words) < 2: return