test(text): cover Russian XSAMPA normalization

This commit is contained in:
iibaranov-IG 2026-07-30 02:17:01 -07:00
parent 150b77110e
commit 17c7cf5f9b

View File

@ -0,0 +1,28 @@
import pytest
from GPT_SoVITS.text.russian import normalize_xsampa_symbol
@pytest.mark.parametrize(
("symbol", "expected"),
[
("d'", "D"),
("n'", "N"),
("r'", "R"),
("l'", "L"),
("a:", "A"),
("1", "I"),
("@", "A"),
("6", "A"),
("s`", "S"),
("S`", "S"),
],
)
def test_normalize_russian_xsampa_symbol(symbol, expected):
assert normalize_xsampa_symbol(symbol) == expected
@pytest.mark.parametrize("symbol", ["", "?", "t_s", None])
def test_normalize_russian_xsampa_symbol_rejects_unsupported_input(symbol):
with pytest.raises(ValueError, match="Russian XSAMPA|Unsupported Russian"):
normalize_xsampa_symbol(symbol)