Fixed a transcript bug.

This commit is contained in:
Howard Abrams 2025-06-05 22:41:10 -07:00
parent 1f5a776ebd
commit 673b43605b

View file

@ -194,16 +194,20 @@ class Shrub(Puppet):
Maybe prepend a 'The' to the front. Maybe prepend a 'The' to the front.
""" """
logger.info(f"capitalize: {text} / {msg_type}")
if msg_type and msg_type in ('traverse', 'teleport'): if msg_type and msg_type in ('traverse', 'teleport'):
if match(r"^(\|[A-z])?[aeiou]", text): if match(r"^(\|[A-z])?[aeiou]", text):
return "An " + text return "An " + text
else: else:
return "A " + text 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 return "The " + text
elif match(r"^(\|[A-z])[a-z]", text) and len(text) > 2: elif match(r"^(\|[A-z])[a-z]", text) and len(text) > 2:
return text[0:1] + text[2].upper() + text[3:] return text[0:2] + text[2].upper() + text[3:]
elif match(r"^(\|[A-z])?[a-z]", text) and len(text) > 2: elif match(r"^[a-z]", text) and len(text) > 2:
return text[0].upper() + text[1:] return text[0].upper() + text[1:]
return text return text