MCPcopy
hub / github.com/QData/TextAttack / test_word_replacement

Method test_word_replacement

tests/test_attacked_text.py:100–108  ·  view source on GitHub ↗
(self, attacked_text)

Source from the content-addressed store, hash-verified

98 assert attacked_text_pair.tokenizer_input == (premise, hypothesis)
99
100 def test_word_replacement(self, attacked_text):
101 assert (
102 attacked_text.replace_word_at_index(3, "down").text
103 == "A person walks down stairs into a room and sees beer poured from a keg and people talking."
104 )
105 assert (
106 attacked_text.replace_word_at_index(10, "wine").text
107 == "A person walks up stairs into a room and sees wine poured from a keg and people talking."
108 )
109
110 def test_multi_word_replacement(self, attacked_text):
111 new_text = attacked_text.replace_words_at_indices(

Callers

nothing calls this directly

Calls 1

replace_word_at_indexMethod · 0.80

Tested by

no test coverage detected