import pytest

from addok.helpers.text import Token
from addok_fr.utils import phonemicize


@pytest.mark.parametrize('input,output', [
    ['cergy', 'serji'],
    ['andresy', 'andrezi'],
    ['conflans', 'konflan'],
    ['watel', 'vatel'],
    ['dunkerque', 'dunkerk'],
    ['robecq', 'robek'],
    ['wardrecques', 'vardrek'],
    ['cabourg', 'kabour'],
    ['audinghen', 'audingen'],
    ['sault', 'sau'],
    ['vaux', 'vau'],
    ['guyancourt', 'guiankour'],
    ['abasset', 'abaset'],
    ['agenest', 'ajenest'],
    ['allmendhurst', 'almendurst'],
    ['ableh', 'abl'],
    ['abilhous', 'abilou'],
    ['aberystwyth', 'aberistvit'],
    ['amfreville', 'anfrevil'],
    ['rimfort', 'rinfor'],
    ['pietricaggio', 'pietrikagio'],
    ['abatesco', 'abatesko'],
    ['albiosc', 'albiosk'],
    ['desc', 'desk'],
    ['bricquebec', 'brikebek'],
    ['locmariaquer', 'lokmariaker'],
    ['ancetres', 'ansetr'],
    ['vicdessos', 'vikdeso'],
    ['acacias', 'akasia'],
    ['placis', 'plasi'],
    ['courcome', 'kourkom'],
    ['hazebrouck', 'azebrouk'],
    ['blotzheim', 'blotzaim'],
    ['plouhinec', 'plouinek'],
    ['hirschland', 'irchlan'],
    ['schlierbach', 'chlierbak'],
    ['aebtissinboesch', 'ebtisinbeuch'],
    ['boescherbach', 'beucherbak'],
    ['affelderwoert', 'afelderveur'],
    ['boeuff', 'beuf'],
    ['boeufs', 'beu'],
    ['humeroeuille', 'umereuil'],
    ['aigueboeuf', 'aigebeuf'],
    ['boeshoernel', 'beucheurnel'],
    ['10a', '10a'],
    ['10b', '10b'],
    ['10c', '10c'],
    ['10d', '10d'],
    ['10e', '10e'],
    ['10f', '10f'],
    ['10g', '10g'],
    ['10h', '10h'],
    ['10i', '10i'],
    ['10j', '10j'],
    ['10k', '10k'],
    ['10l', '10l'],
    ['10m', '10m'],
    ['10n', '10n'],
    ['10o', '10o'],
    ['10p', '10p'],
    ['10q', '10q'],
    ['10r', '10r'],
    ['10s', '10s'],
    ['10t', '10t'],
    ['10u', '10u'],
    ['10v', '10v'],
    ['10w', '10w'],
    ['10x', '10x'],
    ['10y', '10y'],
    ['10z', '10z'],
    ['1a', '1a'],
    ['1b', '1b'],
    ['1c', '1c'],
    ['1d', '1d'],
    ['1e', '1e'],
    ['1f', '1f'],
    ['1g', '1g'],
    ['1h', '1h'],
    ['1i', '1i'],
    ['1j', '1j'],
    ['1k', '1k'],
    ['1l', '1l'],
    ['1m', '1m'],
    ['1n', '1n'],
    ['1o', '1o'],
    ['1p', '1p'],
    ['1q', '1q'],
    ['1r', '1r'],
    ['1s', '1s'],
    ['1t', '1t'],
    ['1u', '1u'],
    ['1v', '1v'],
    ['1w', '1w'],
    ['1x', '1x'],
    ['1y', '1y'],
    ['1z', '1z'],
    ['quimper', 'kinper'],
    ['georges', 'jorj'],
    ['gorges', 'gorj'],
    ['h', 'h'],
    ['vallee', 'vale'],
    ['valllee', 'vale'],
    ['montgriffon', 'mongrifon'],
    ['montagne', 'montagn'],
    ['montage', 'montaj'],
    ['champs', 'chan'],
    ['grandchamps', 'granchan'],
    ['vingt', 'vin'],
    ['vingtieme', 'vintiem'],
    ['champvallon', 'chanvalon'],
    ['champol', 'chanpol'],
    ['montbon', 'monbon'],
    ['montgros', 'mongro'],
    ['blanc', 'blan'],
    ['montee', 'monte'],
    ['seigneur', 'senieur'],
    ['pforzheim', 'pforzaim'],
    ['hyppolyte', 'ipolit'],
])
def test_phonemicize(input, output):
    assert phonemicize(Token(input)) == output
