# Path: pypinyin/pinyin_dict.py

# 
# Path: pypinyin/contrib/tone_convert.py



from pytest import mark
from pypinyin import pinyin_dict
from pypinyin.contrib.tone_convert import (
    tone_to_normal,
    tone_to_tone2,
    tone2_to_tone,
    tone_to_tone3,
    tone3_to_tone,
    tone2_to_normal,
    tone2_to_tone3,
    tone3_to_tone2,
    tone3_to_normal,
    to_normal,
    to_tone,
    to_tone2,
    to_tone3,
    to_initials,
    to_finals,
    to_finals_tone,
    to_finals_tone2,
    to_finals_tone3,
)
    ['yu', False, 'y'],
])
def test_to_initials(pinyin, strict, result):
    assert to_initials(pinyin, strict=strict) == result


@mark.parametrize('pinyin,strict,v_to_u,result', [
    ['zhōng', True, False, 'ong'],
    ['zhōng', False, False, 'ong'],

    ['zho1ng', True, False, 'ong'],
    ['zho1ng', False, False, 'ong'],

    ['zhong1', True, False, 'ong'],
    ['zhong1', False, False, 'ong'],

    ['zhong', True, False, 'ong'],
    ['zhong', False, False, 'ong'],

    ['nǚ', True, False, 'v'],
    ['nv', True, False, 'v'],
    ['nü', True, False, 'v'],
    ['nǚ', True, True, 'ü'],
    ['nü', True, True, 'ü'],
    ['nv', True, True, 'ü'],

    ['gui', True, False, 'uei'],
    ['gui', False, False, 'ui'],
])
def test_to_finals(pinyin, strict, v_to_u, result):

# Path: pypinyin/pinyin_dict.py

# 
# Path: pypinyin/contrib/tone_convert.py



# Path: tests/contrib/test_tone_convert.py
from pytest import mark
from pypinyin import pinyin_dict
from pypinyin.contrib.tone_convert import (
    tone_to_normal,
    tone_to_tone2,
    tone2_to_tone,
    tone_to_tone3,
    tone3_to_tone,
    tone2_to_normal,
    tone2_to_tone3,
    tone3_to_tone2,
    tone3_to_normal,
    to_normal,
    to_tone,
    to_tone2,
    to_tone3,
    to_initials,
    to_finals,
    to_finals_tone,
    to_finals_tone2,
    to_finals_tone3,
)

    ['yu', False, 'y'],
])
def test_to_initials(pinyin, strict, result):
    assert to_initials(pinyin, strict=strict) == result


@mark.parametrize('pinyin,strict,v_to_u,result', [
    ['zhōng', True, False, 'ong'],
    ['zhōng', False, False, 'ong'],

    ['zho1ng', True, False, 'ong'],
    ['zho1ng', False, False, 'ong'],

    ['zhong1', True, False, 'ong'],
    ['zhong1', False, False, 'ong'],

    ['zhong', True, False, 'ong'],
    ['zhong', False, False, 'ong'],

    ['nǚ', True, False, 'v'],
    ['nv', True, False, 'v'],
    ['nü', True, False, 'v'],
    ['nǚ', True, True, 'ü'],
    ['nü', True, True, 'ü'],
    ['nv', True, True, 'ü'],

    ['gui', True, False, 'uei'],
    ['gui', False, False, 'ui'],
])
def test_to_finals(pinyin, strict, v_to_u, result):

    assert to_finals(pinyin, strict=strict, v_to_u=v_to_u) == result