aboutsummaryrefslogtreecommitdiff
path: root/markov/markov.py
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-03-09 14:16:30 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-03-09 14:16:30 +0000
commit118f7d22503fc8c2c9499103af6f1b430113221d (patch)
tree4bf5e1a8e429e3a381fa0d636c4091a61614fa0b /markov/markov.py
parente7d2973f33bfd6088bbad8f53a10c4f8cab72fd9 (diff)
downloadaps-cogs-118f7d22503fc8c2c9499103af6f1b430113221d.tar
aps-cogs-118f7d22503fc8c2c9499103af6f1b430113221d.tar.gz
aps-cogs-118f7d22503fc8c2c9499103af6f1b430113221d.zip
markov: don't add space after forward slash
Diffstat (limited to 'markov/markov.py')
-rw-r--r--markov/markov.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/markov/markov.py b/markov/markov.py
index 3acf2dd..8081b07 100644
--- a/markov/markov.py
+++ b/markov/markov.py
@@ -404,7 +404,9 @@ class Markov(commands.Cog):
next_token, frequency = row
if random.randint(1, completion_count) <= frequency:
- if next_token in PUNCTUATION:
+ if next_token == "/":
+ result = result[:-1] + next_token
+ elif next_token in PUNCTUATION:
result = result[:-1] + next_token + " "
else:
result += next_token + " "