26 lines
775 B
Python
26 lines
775 B
Python
from soundchanger.change import apply
|
|
|
|
|
|
def test_apply_without_environment():
|
|
assert apply('p>h', 'pana') == 'hana'
|
|
|
|
def test_apply_with_environment():
|
|
assert apply('p>f/#_u', 'pune') == 'fune'
|
|
|
|
def test_apply_with_complex_environment():
|
|
inputs = ['pana', 'pina', 'puna', 'pama', 'pima', 'puma']
|
|
outputs = ['pana', 'hina', 'huna', 'pama', 'hima', 'huma']
|
|
for string, output in zip(inputs, outputs):
|
|
assert apply(
|
|
change='p>h/#_{u,i}Na#',
|
|
string=string,
|
|
categories={'N': 'nm'}
|
|
) == output
|
|
|
|
def test_apply_with_complex_group_and_categories():
|
|
assert apply('e>i/{#,p,t,k}V{m,n,h}_#', 'pane', categories={
|
|
'V': 'aiu',
|
|
'P': 'ptk',
|
|
'N': 'mn',
|
|
}) == 'pani'
|