From 673b43605ba7ae827b1fa31e8dd8a3257bb45390 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Thu, 5 Jun 2025 22:41:10 -0700 Subject: [PATCH] Fixed a transcript bug. --- typeclasses/puppets.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/typeclasses/puppets.py b/typeclasses/puppets.py index 4a45a78..c471bc5 100755 --- a/typeclasses/puppets.py +++ b/typeclasses/puppets.py @@ -194,16 +194,20 @@ class Shrub(Puppet): Maybe prepend a 'The' to the front. """ + logger.info(f"capitalize: {text} / {msg_type}") if msg_type and msg_type in ('traverse', 'teleport'): if match(r"^(\|[A-z])?[aeiou]", text): return "An " + text else: return "A " + text - elif msg_type and msg_type == 'say' and match(r"^\|b[a-z]", text): + # If the line is colored and lowercase, it probably assumes a + # character's sdesc, so let's add a 'the' to the front: + # Do we need to only do this on 'say'? + elif match(r"^\|[mb][a-z]", text): return "The " + text elif match(r"^(\|[A-z])[a-z]", text) and len(text) > 2: - return text[0:1] + text[2].upper() + text[3:] - elif match(r"^(\|[A-z])?[a-z]", text) and len(text) > 2: + return text[0:2] + text[2].upper() + text[3:] + elif match(r"^[a-z]", text) and len(text) > 2: return text[0].upper() + text[1:] return text