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