pyrit.prompt_converter.ZalgoConverter#
- class ZalgoConverter(*, intensity: int = 10, seed: int | None = None, word_selection_strategy: WordSelectionStrategy | None = None)[source]#
Bases:
WordLevelConverterConverts text into cursed Zalgo text using combining Unicode marks.
- __init__(*, intensity: int = 10, seed: int | None = None, word_selection_strategy: WordSelectionStrategy | None = None)[source]#
Initialize the converter with the specified selection parameters.
- Parameters:
intensity (int) – Number of combining marks per character (higher = more cursed). Default is 10.
seed (Optional[int]) – Optional seed for reproducible output.
word_selection_strategy (Optional[WordSelectionStrategy]) – Strategy for selecting which words to convert. If None, all words will be converted.
Methods
__init__(*[, intensity, seed, ...])Initialize the converter with the specified selection parameters.
convert_async(*, prompt[, input_type])Convert the given prompt into the target format supported by the converter.
convert_tokens_async(*, prompt[, ...])Convert substrings within a prompt that are enclosed by specified start and end tokens.
convert_word_async(word)Convert a single word into the target format supported by the converter.
get_identifier()Return an identifier dictionary for the converter.
input_supported(input_type)Check if the input type is supported by the converter.
join_words(words)Provide a way for subclasses to override the default behavior of joining words.
output_supported(output_type)Check if the output type is supported by the converter.
validate_input(prompt)Validate the input prompt before conversion.
Attributes
SUPPORTED_INPUT_TYPESTuple of input modalities supported by this converter.
SUPPORTED_OUTPUT_TYPESTuple of output modalities supported by this converter.
supported_input_typesReturns a list of supported input types for the converter.
supported_output_typesReturns a list of supported output types for the converter.