API Reference
find_next_letter(text, placeholder)
Find the next letter after a placeholder in a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
The string to search within. |
required |
placeholder
|
str
|
The placeholder string to find. |
required |
Returns:
Type | Description |
---|---|
str
|
The character immediately following the placeholder. |
format_str(text)
Format a string by removing HTML tags, sprite presets, and ruby tags, and replacing pronouns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
The input string to format. |
required |
Returns:
Type | Description |
---|---|
str
|
The formatted string. |
remove_ruby_tags(text)
Remove ruby tags ({RUBY_B...} and {RUBY_E#}) from a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
The input string containing ruby tags. |
required |
Returns:
Type | Description |
---|---|
str
|
The string with ruby tags removed. |
replace_placeholders(string, params)
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:
Name | Type | Description | Default |
---|---|---|---|
string
|
str
|
The string containing placeholders. |
required |
params
|
dict[str, list[float | int]] | list[int] | None
|
A dictionary or list of parameters to substitute. |
required |
Returns:
Type | Description |
---|---|
str
|
The string with placeholders replaced by values. |
replace_pronouns(text)
Replace gendered pronouns in the format {F#female}/{M#male} with a combined format.
Example
"{F#She}/{M#He} is here." -> "She/He is here."
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
The input string containing pronouns. |
required |
Returns:
Type | Description |
---|---|
str
|
The string with pronouns replaced. |