mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-09-11 11:05:43 +08:00
test(text): cover Russian XSAMPA normalization
This commit is contained in:
parent
150b77110e
commit
17c7cf5f9b
28
tests/test_russian_phonemes.py
Normal file
28
tests/test_russian_phonemes.py
Normal 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)
|
||||
Loading…
x
Reference in New Issue
Block a user