API Reference
utils
Functions:
-
find_next_letter–Find the next letter after a placeholder in a string.
-
format_str–Format a string by removing HTML tags, sprite presets, and ruby tags, and replacing pronouns.
-
remove_ruby_tags–Remove ruby tags ({RUBY_B...} and {RUBY_E#}) from a string.
-
replace_placeholders–Replace placeholders in a string with values from parameters.
-
replace_pronouns–Replace gendered pronouns in the format {F#female}/{M#male} with a combined format.
find_next_letter
find_next_letter(text: str, placeholder: str) -> str
format_str
remove_ruby_tags
replace_placeholders
Replace placeholders in a string with values from parameters.
Handle both list-based and dictionary-based parameters. Multiply values by 100 if the character following the placeholder is '%'.
Parameters:
-
(stringstr) –The string containing placeholders.
-
(paramsdict[str, list[float | int]] | list[int] | None) –A dictionary or list of parameters to substitute.
Returns:
-
str–The string with placeholders replaced by values.