()
| 434 | |
| 435 | |
| 436 | def test_hard_target_prefix(): |
| 437 | translator = _get_transliterator() |
| 438 | output = translator.translate_batch( |
| 439 | [["آ", "ت", "ز", "م", "و", "ن"], ["آ", "ت", "ش", "ي", "س", "و", "ن"]], |
| 440 | target_prefix=[["a", "t", "s"], None], |
| 441 | ) |
| 442 | assert output[0].hypotheses[0][:3] == ["a", "t", "s"] |
| 443 | assert output[1].hypotheses[0] == ["a", "c", "h", "i", "s", "o", "n"] |
| 444 | |
| 445 | |
| 446 | @pytest.mark.parametrize("beam_size", [1, 2]) |
nothing calls this directly
no test coverage detected