Fixed a transcript bug.
This commit is contained in:
parent
1f5a776ebd
commit
673b43605b
1 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue