pyrit.prompt_converter.WordIndexSelectionStrategy#
- class WordIndexSelectionStrategy(*, indices: List[int])[source]#
Bases:
WordSelectionStrategySelects words based on their indices in the word list.
- __init__(*, indices: List[int]) None[source]#
Initializes the word index selection strategy.
- Parameters:
indices (List[int]) – The list of word indices to select.
Methods
__init__(*, indices)Initializes the word index selection strategy.
select_range(*, text[, word_separator])Selects a character range by first selecting words, then converting to character positions.
select_words(*, words)Selects words at the specified indices.