pronoun-o-matic/pronoun_update.py

14 lines
296 B
Python
Raw Normal View History

2022-06-05 18:39:22 +02:00
import re
PRONOUN_REPLACE_REGEX = re.compile(r"\[S*\]")
2022-06-04 22:18:32 +02:00
class PronounUpdate:
pronouns: str
def __init__(self, pronouns: str):
self.pronouns = pronouns
def replace_pronouns_in_bio(self, bio: str) -> str:
2022-06-05 18:39:22 +02:00
return PRONOUN_REPLACE_REGEX.sub(bio, f"[{self.pronouns}]")