Return to repo list

tzed

Simple story-driven open world 2D CRPG.
Return to HMagellan.com

commit f93da1294ee29c74282f276fabeca9dfa8fc340e
parent 3254bc13ad418211783b5bac9d4407280c202c57
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed, 25 Aug 2021 19:49:41 -0500

message parse now handles basic punctuation

Diffstat:
Msrc/message.py | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/message.py b/src/message.py @@ -69,14 +69,14 @@ class MessageBoard(object): if text != "": # First, parse for data variable names - pr = re.split(r' ', text) + punc = ",.!?'" + pr = re.split(r"([ " + punc + "])", text) for w in range(0, len(pr)): if pr[w] in data.keys(): pr[w] = data[pr[w]] wtext = "" for w2 in pr: - wtext = wtext + " " + w2 - wtext = wtext[0:] + wtext += w2 # Next, handle adding and pruning the message list self.messages.append(wtext)