# pylint: disable=anomalous-backslash-in-string
# pylint: disable=no-init, too-few-public-methods
"""Unittest for fr_pron.py
Testcases modified from https://en.wiktionary.org/wiki/Module:fr-pron/testcases.
"""

from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals

try:
    import unittest2 as unittest
except ImportError:
    import unittest
from six import with_metaclass

from .. import fr_pron


# Testcases for French text to IPA conversion
TESTCASES = [
    # ((text, pos), IPA),
    # A:
    (("patte",), "pat"),
    (("arable",), "a.ʁabl"),
    (("sa",), "sa"),
    (("bâse",), "bɑz"),
    # À:
    (("là",), "la"),
    (("déjà",), "de.ʒa"),
    # Â:
    (("château",), "ʃɑ.to"),
    (("pâte",), "pɑt"),
    # Æ:
    (("hæmorrhagie",), "e.mɔ.ʁa.ʒi"),
    (("æstimer",), "ɛs.ti.me"),
    (("quæstion",), "kɛs.tjɔ̃"),
    # AI:
    (("vrai",), "vʁɛ"),
    (("faite",), "fɛt"),
    (("bésser",), "be.se"),
    (("éguille",), "e.ɡij"),
    (("fesons",), "fə.zɔ̃"),
    (("parlerai", "v"), "paʁ.lə.ʁe"),
    (("chaîne",), "ʃɛn"),
    (("baie",), "bɛ"),
    (("monnaie",), "mɔ.nɛ"),
    (("paieriez",), "pɛ.ʁje"),
    # AOU:
    (("aoûtien",), "a.u.sjɛ̃"),
    (("oute",), "ut"),
    # AU:
    (("haut",), "o"),
    (("augure",), "o.ɡyʁ"),
    (("autre",), "otʁ"),
    (("restorant",), "ʁɛs.tɔ.ʁɑ̃"),
    (("restorer",), "ʁɛs.tɔ.ʁe"),
    (("dinosore",), "di.no.zɔʁ"),
    # AY:
    (("ayons",), "ɛ.jɔ̃"),
    (("Gamay",), "ɡa.mɛ"),
    (("maillonnaise",), "ma.jɔ.nɛz"),
    (("papaille",), "pa.paj"),
    (("ailloille",), "a.jɔj"),
    (("abbèi",), "a.bɛ.i"),
    # B:
    (("plomb",), "plɔ̃"),
    # C:
    (("blanc",), "blɑ̃"),
    (("caoutchou",), "ka.ut.ʃu"),
    (("accueil",), "a.kœj"),
    (("cercueil",), "sɛʁ.kœj"),
    (("taba",), "ta.ba"),
    (("estoma",), "ɛs.tɔ.ma"),
    (("por",), "pɔʁ"),
    (("caos",), "ka.o"),
    (("clore",), "klɔʁ"),
    (("varec",), "va.ʁɛk"),
    (("almana",), "al.ma.na"),
    (("yote",), "jɔt"),
    (("accès",), "ak.sɛ"),
    (("accord",), "a.kɔʁ"),
    (("direct",), "di.ʁɛkt"),
    (("correct",), "kɔ.ʁɛkt"),
    (("instinct",), "ɛ̃s.tɛ̃"),
    (("succinct",), "syk.sɛ̃"),
    (("respè",), "ʁɛs.pɛ"),
    (("suspè",), "sys.pɛ"),
    (("donque",), "dɔ̃k"),
    (("parc",), "paʁk"),
    (("sec",), "sɛk"),
    (("c'était",), "s‿e.tɛ"),
    # Ç:
    (("ça",), "sa"),
    (("commençons",), "kɔ.mɑ̃.sɔ̃"),
    (("hameçon",), "am.sɔ̃"),
    # CH:
    (("blanche",), "blɑ̃ʃ"),
    (("caos",), "ka.o"),
    (("clore",), "klɔʁ"),
    (("varec",), "va.ʁɛk"),
    (("almana",), "al.ma.na"),
    (("schnapse",), "ʃnaps"),
    (("esche",), "ɛʃ"),
    # D:
    (("vend",), "vɑ̃"),
    (("donnée",), "dɔ.ne"),
    (("addition",), "a.di.sjɔ̃"),
    (("pied",), "pje"),
    # E:
    (("emmène",), "ɑ̃.mɛn"),
    (("emmener",), "ɑ̃m.ne"),
    (("émmental",), "e.mɑ̃.tal"),
    (("effacer",), "e.fa.se"),
    (("emmuseler",), "ɑ̃.myz.le"),
    (("ennuyer",), "ɑ̃.nɥi.je"),
    (("parle",), "paʁl"),
    (("table",), "tabl"),
    (("table rouge",), "ta.blə ʁuʒ"),
    (("table de",), "ta.blə də"),
    (("loup de merre",), "lu d(ə) mɛʁ"),
    (("mettre de côté",), "mɛ.tʁə d(ə) ko.te"),
    (("sucre en poudre",), "sykʁ ɑ̃ pudʁ"),
    (("famme",), "fam"),
    (("permet",), "pɛʁ.mɛ"),
    (("prudemment",), "pʁy.da.mɑ̃"),
    (("venir",), "və.niʁ"),
    (("devenir",), "də.v(ə).niʁ"),
    (("parlerons",), "paʁ.lə.ʁɔ̃"),
    (("racheter",), "ʁaʃ.te"),
    (("rachetons",), "ʁaʃ.tɔ̃"),
    (("repĕser",), "ʁə.pə.ze"),
    (("que",), "kə"),
    (("je",), "ʒə"),
    (("henné",), "e.ne"),
    (("ses",), "se"),
    (("tes",), "te"),
    (("les",), "le"),
    (("es",), "ɛ"),
    (("blesserons",), "blɛ.sʁɔ̃"),
    (("blesse",), "blɛs"),
    (("cèderons",), "sɛ.dʁɔ̃"),
    (("soierie",), "swa.ʁi"),
    (("dép(ə)cez",), "de.p(ə).se"),
    (("clamecez",), "klam.se"),
    (("ressortir",), "ʁə.sɔʁ.tiʁ"),
    (("èssayer",), "ɛ.sɛ.je"),
    (("ésséyer",), "e.se.je"),
    (("mettez",), "mɛ.te"),
    (("mettrez",), "mɛ.tʁe"),
    (("décevoir",), "de.sə.vwaʁ"),
    (("ressemeler",), "ʁə.sə.m(ə).le"),
    (("ressemelle",), "ʁə.s(ə).mɛl"),
    (("ressemelez",), "ʁə.sə.m(ə).le"),
    (("vous ressemelez",), "vu ʁ(ə).sə.m(ə).le"),
    (("je regarde",), "ʒə ʁ(ə).ɡaʁd"),
    (("genièvre",), "ʒə.njɛvʁ"),
    (("dəssous",), "də.su"), # should work with the correct schwa
    (("dǝssous",), "də.su"), # and with the wrong one
    (("vis‿à-vis de",), "vi.z‿a.vi də"),
    (("de part et d'autre de",), "də paʁ e d‿o.tʁə də"), # et should be /e/
    (("au-dehors",), "o.də.ɔʁ"), # schwa is required not optional
    (("troisièmėment",), "tʁwa.zjɛm.mɑ̃"),
    (("vingt‿et-un",), "vɛ̃.t‿e.œ̃"), # et should be /e/ in liaison too
    (("déchirerez",), "de.ʃi.ʁə.ʁe"),
    (("saladerie",), "sa.la.dʁi"),
    # É: 
    (("gémit",), "ʒe.mi"),
    (("bénédiction",), "be.ne.dik.sjɔ̃"),
    (("agréerons",), "a.ɡʁe.ʁɔ̃"),
    (("agréerions",), "a.ɡʁe.ʁjɔ̃"),
    (("agréons",), "a.ɡʁe.ɔ̃"),
    (("agréions",), "a.ɡʁej.jɔ̃"),
    (("agréé",), "a.ɡʁe.e"),
    # È:
    (("rachète",), "ʁa.ʃɛt"),
    (("dépèce",), "de.pɛs"),
    (("très",), "tʁɛ"),
    # Ê:
    (("dépêcher",), "de.pɛ.ʃe"),
    # EAU:
    (("beaux",), "bo"),
    # EI:
    (("seine",), "sɛn"),
    (("neige",), "nɛʒ"),
    (("reître",), "ʁɛtʁ"),
    # EU:
    (("jeune",), "ʒœn"),
    (("jeûne",), "ʒøn"),
    (("neûtre",), "nøtʁ"),
    (("feûtre",), "føtʁ"),
    (("chanteuse",), "ʃɑ̃.tøz"),
    (("heureux",), "œ.ʁø"),
    (("peu",), "pø"),
    (("u",), "y"),
    (("usse",), "ys"),
    (("ûmes",), "ym"),
    (("bleûet",), "blø.ɛ"),
    (("bleûètière",), "blø.ɛ.tjɛʁ"),
    (("maïeûtique",), "ma.jø.tik"),
    # F:
    (("bœuf",), "bœf"),
    (("bœux",), "bø"),
    (("cerre",), "sɛʁ"),
    (("clé",), "kle"),
    (("nerre",), "nɛʁ"),
    (("neuf",), "nœf"),
    (("œuf",), "œf"),
    (("œux",), "ø"),
    (("souffrir",), "su.fʁiʁ"),
    # G:
    (("gens",), "ʒɑ̃"),
    (("ange",), "ɑ̃ʒ"),
    (("mangeait",), "mɑ̃.ʒɛ"),
    (("mangeons",), "mɑ̃.ʒɔ̃"),
    (("bourgeois",), "buʁ.ʒwa"),
    (("geai",), "ʒɛ"),
    (("joug",), "ʒu"),
    (("zigzague",), "ziɡ.zaɡ"),
    (("suggérer",), "syɡ.ʒe.ʁe"),
    (("longtemps",), "lɔ̃.tɑ̃"),
    (("vingt",), "vɛ̃"),
    (("geignais",), "ʒɛ.ɲɛ"),
    (("voyageur",), "vwa.ja.ʒœʁ"),
    (("manadjme_nte",), "ma.nadʒ.mɛnt"),
    (("mana(d)jment",), "ma.na(d)ʒ.mɑ̃"),
    (("syndrome d'Aspergĕr",), "sɛ̃.dʁɔm d‿as.pɛʁ.ʒəʁ"),
    # GN:
    (("montagne",), "mɔ̃.taɲ"),
    (("agneau",), "a.ɲo"),
    (("g_nou",), "ɡnu"),
    (("baignoire",), "bɛ.ɲwaʁ"),
    (("éteigniez",), "e.tɛ.ɲje"),
    (("gnon",), "ɲɔ̃"),
    (("g_nose",), "ɡnoz"),
    (("gnouf",), "ɲuf"),
    (("gnangnan",), "ɲɑ̃.ɲɑ̃"),
    (("gnôle",), "ɲol"),
    (("bagne",), "baɲ"),
    (("cog_nitif",), "kɔɡ.ni.tif"),
    # GU:
    (("augure",), "o.ɡyʁ"),
    (("aigue",), "ɛɡ"),
    (("aigu",), "ɛ.ɡy"),
    (("aiguë",), "ɛ.ɡy"),
    (("blaguons",), "bla.ɡɔ̃"),
    (("guide",), "ɡid"),
    (("vaguant",), "va.ɡɑ̃"),
    (("orgueil",), "ɔʁ.ɡœj"),
    # H:
    (("habite",), "a.bit"),
    (("houe",), "u"),
    (("hache",), "aʃ"),
    (("ahurir",), "a.y.ʁiʁ"),
    (("envahir",), "ɑ̃.va.iʁ"),
    # I:
    (("importante",), "ɛ̃.pɔʁ.tɑ̃t"),
    (("bruis",), "bʁɥi"),
    (("brui",), "bʁɥi"),
    (("ion",), "jɔ̃"),
    (("triage",), "tʁi.jaʒ"),
    (("trierons",), "tʁi.ʁɔ̃"),
    (("étudierons",), "e.ty.di.ʁɔ̃"),
    (("étudierions",), "e.ty.di.ʁjɔ̃"),
    (("étudions",), "e.ty.djɔ̃"),
    (("étudiions",), "e.ty.di.jɔ̃"),
    (("abstiennent", "v"), "ap.stjɛn"),
    # Î:
    (("gîte",), "ʒit"),
    (("huîtres",), "ɥitʁ"),
    # Ï:
    (("naïf",), "na.if"),
    (("haïr",), "a.iʁ"),
    (("maïsse",), "ma.is"),
    (("aille",), "aj"),
    (("ïambe",), "jɑ̃b"),
    (("aïeul",), "a.jœl"),
    (("païen",), "pa.jɛ̃"),
    (("amu_ir",), "a.my.iʁ"),
    (("ouï",), "wi"),
    (("ouïe",), "wi"),
    (("ouïr",), "wiʁ"),
    (("ouïrais",), "wi.ʁɛ"),
    (("coïte",), "kɔ.it"),
    (("astéroïde",), "as.te.ʁɔ.id"),
    (("ambiguïser",), "ɑ̃.bi.ɡɥi.ze"),
    # IEN:
    (("orianteur",), "ɔ.ʁjɑ̃.tœʁ"),
    (("sciance",), "sjɑ̃s"),
    (("rien",), "ʁjɛ̃"),
    (("vien", "v"), "vjɛ̃"),
    (("viendra",), "vjɛ̃.dʁa"),
    # J:
    # K:
    (("kilogramme",), "ki.lɔ.ɡʁam"),
    (("bifteck",), "bif.tɛk"),
    # L:
    (("batailler",), "ba.ta.je"),
    (("feuille",), "fœj"),
    (("feuilleter",), "fœj.te"),
    (("feuillette",), "fœ.jɛt"),
    (("feuilletons",), "fœj.tɔ̃"),
    (("réveiller",), "ʁe.vɛ.je"),
    (("cueillir",), "kœ.jiʁ"),
    (("dringuelle",), "dʁɛ̃.ɡɛl"),
    (("fisse",), "fis"),
    (("fiç",), "fis"),
    (("fille",), "fij"),
    (("fil",), "fil"),
    (("vile",), "vil"),
    (("mile",), "mil"),
    (("vilage",), "vi.laʒ"),
    (("au",), "o"),
    (("fusi",), "fy.zi"),
    (("outi",), "u.ti"),
    (("cu",), "ky"),
    (("sou",), "su"),
    (("soleil",), "sɔ.lɛj"),
    (("ail",), "aj"),
    (("poil",), "pwal"),
    (("travaille",), "tʁa.vaj"),
    (("vieille",), "vjɛj"),
    (("juillet",), "ʒɥi.jɛ"),
    (("aiguïlle",), "ɛ.ɡɥij"),
    (("illuminer",), "i.ly.mi.ne"),
    # M:
    (("faim",), "fɛ̃"),
    (("pomme",), "pɔm"),
    (("autonne",), "o.tɔn"),
    (("condanner",), "kɔ̃.da.ne"),
    (("boum",), "bum"),
    (("parfun",), "paʁ.fœ̃"),
    (("maximum",), "mak.si.mɔm"),
    (("album",), "al.bɔm"),
    (("ombre",), "ɔ̃bʁ"),
    (("totem",), "tɔ.tɛm"),
    (("sympa",), "sɛ̃.pa"),
    (("gymnase",), "ʒim.naz"),
    (("hymne",), "imn"),
    (("Reims",), "ʁɛ̃"),
    (("comment",), "kɔ.mɑ̃"),
    (("amse tram gram",), "ams tʁam ɡʁam"),
    (("ashram",), "aʃ.ʁam"),
    (("dan",), "dɑ̃"),
    (("denim",), "də.nim"),
    (("pronom",), "pʁɔ.nɔ̃"),
    (("circumlunaire",), "siʁ.kɔm.ly.nɛʁ"),
    # N:
    (("une",), "yn"),
    (("distance",), "dis.tɑ̃s"),
    (("atteine",), "a.tɛn"),
    (("attein",), "a.tɛ̃"),
    (("attei",), "a.tɛ"),
    (("surmène",), "syʁ.mɛn"),
    (("surmeni",), "syʁ.mə.ni"),
    (("joindre",), "ʒwɛ̃dʁ"),
    (("saint",), "sɛ̃"),
    (("examin",), "ɛɡ.za.mɛ̃"),
    (("bin",), "bɛ̃"),
    (("européen",), "œ.ʁɔ.pe.ɛ̃"),
    (("doyen",), "dwa.jɛ̃"),
    (("à jeun",), "a ʒœ̃"),
    (("juin",), "ʒɥɛ̃"),
    (("parlent", "v"), "paʁl"),
    (("finissaient", "v"), "fi.ni.sɛ"),
    (("servent", "v"), "sɛʁv"),
    (("cagnonne",), "ka.ɲɔn"),
    (("mecieu",), "mə.sjø"),
    (("brun",), "bʁœ̃"),
    (("syndrôme",), "sɛ̃.dʁom"),
    (("tînmes",), "tɛ̃m"),
    (("tînrent", "v"), "tɛ̃ʁ"),
    (("annexe",), "a.nɛks"),
    (("Bouroundi",), "bu.ʁun.di"),
    (("Cameroun",), "kam.ʁun"),
    (("spri_nter",), "spʁin.te"),
    (("chinois",), "ʃi.nwa"),
    # NG:
    (("long",), "lɔ̃"),
    (("sang",), "sɑ̃"),
    (("poing",), "pwɛ̃"),
    (("poings",), "pwɛ̃"),
    (("shampoing",), "ʃɑ̃.pwɛ̃"),
    (("parking",), "paʁ.kiŋ"),
    (("camping",), "kɑ̃.piŋ"),
    (("shopping",), "ʃɔ.piŋ"),
    (("chwing-gomme",), "ʃwiŋ.ɡɔm"),
    # O:
    (("modeler",), "mɔ.dle"),
    (("euro",), "œ.ʁo"),
    (("chose",), "ʃoz"),
    (("sŏsie",), "sɔ.zi"),
    # Ô:
    (("cône",), "kon"),
    # Œ:
    (("œil",), "œj"),
    (("œillade",), "œ.jad"),
    (("œillet",), "œ.jɛ"),
    (("œsophage",), "e.zɔ.faʒ"),
    (("cœlacanthe",), "se.la.kɑ̃t"),
    (("fœtusse",), "fe.tys"),
    (("œstrogène",), "ɛs.tʁɔ.ʒɛn"),
    # ŒU:
    (("nœud",), "nø"),
    (("vœu",), "vø"),
    (("sœur",), "sœʁ"),
    (("cœur",), "kœʁ"),
    (("œuf",), "œf"),
    # OE:
    (("coéfficiant",), "kɔ.e.fi.sjɑ̃"),
    (("moelle",), "mwal"),
    (("moellon",), "mwa.lɔ̃"),
    (("poêle",), "pwal"),
    (("Noël",), "nɔ.ɛl"),
    (("canoé",), "ka.nɔ.e"),
    (("fouène",), "fwɛn"),
    # OI:
    (("avoir",), "a.vwaʁ"),
    (("noix",), "nwa"),
    (("foie",), "fwa"),
    (("ognon",), "ɔ.ɲɔ̃"),
    (("iroquoien",), "i.ʁɔ.kwa.jɛ̃"),
    (("trois",), "tʁwa"), # not /tʁua/
    (("aboierez",), "a.bwa.ʁe"),
    (("aboient", "v"), "a.bwa"),
    # OU:
    (("ouvrir",), "u.vʁiʁ"),
    (("sous",), "su"),
    (("ouest",), "wɛst"),
    (("couiner",), "kwi.ne"),
    (("cacahouète",), "ka.ka.wɛt"),
    (("roue",), "ʁu"),
    (("goût",), "ɡu"),
    (("brouillard",), "bʁu.jaʁ"),
    (("flouons",), "flu.ɔ̃"),
    (("jouons",), "ʒwɔ̃"),
    (("jouerons",), "ʒu.ʁɔ̃"),
    # OY:
    (("envoyer",), "ɑ̃.vwa.je"),
    (("moyen",), "mwa.jɛ̃"),
    (("royaume",), "ʁwa.jom"),
    (("goillave",), "ɡɔ.jav"),
    # P:
    (("pas",), "pɑ"),
    (("coup",), "ku"),
    (("trop",), "tʁo"),
    (("cape",), "kap"),
    (("ceppe",), "sɛp"),
    (("concepte",), "kɔ̃.sɛpt"),
    (("sette",), "sɛt"),
    (("batême",), "ba.tɛm"),
    (("pront",), "pʁɔ̃"),
    (("temps",), "tɑ̃"),
    (("interromps",), "ɛ̃.tɛ.ʁɔ̃"),
    (("conter",), "kɔ̃.te"),
    (("schtroumf",), "ʃtʁumf"),
    (("corps",), "kɔʁ"),
    # PH:
    (("phrâse",), "fʁɑz"),
    (("graphe",), "ɡʁaf"),
    # Q:
    (("cinque",), "sɛ̃k"),
    (("coq",), "kɔk"),
    # QU:
    (("quand",), "kɑ̃"),
    (("équipe",), "e.kip"),
    (("écuilatéral",), "e.kɥi.la.te.ʁal"),
    (("acouarium",), "a.kwa.ʁjɔm"),
    (("locouace",), "lɔ.kwas"),
    (("couatuor",), "kwa.tɥɔʁ"),
    (("piqûre",), "pi.kyʁ"),
    (("qu'on",), "k‿ɔ̃"),
    # R:
    (("châtre",), "ʃɑtʁ"),
    (("méssieu",), "me.sjø"),
    (("barre",), "baʁ"),
    (("goûter",), "ɡu.te"),
    (("hiverre",), "i.vɛʁ"),
    (("hierre",), "jɛʁ"),
    (("superre",), "sy.pɛʁ"),
    (("éterre",), "e.tɛʁ"),
    (("chemin de fer",), "ʃə.mɛ̃ d(ə) fɛʁ"),
    (("vers",), "vɛʁ"),
    (("finir",), "fi.niʁ"),
    (("part",), "paʁ"),
    (("sert",), "sɛʁ"),
    (("ressert",), "ʁə.sɛʁ"),
    # S:
    (("asien",), "a.zjɛ̃"),
    (("assez",), "a.se"),
    (("anse",), "ɑ̃s"),
    (("penser",), "pɑ̃.se"),
    (("transat",), "tʁɑ̃.za"),
    (("transiter",), "tʁɑ̃.zi.te"),
    (("sciance",), "sjɑ̃s"),
    (("gasoil",), "ɡa.zwal"),
    # SH:
    (("déshabiller",), "de.za.bi.je"),
    (("photoshoper",), "fɔ.tɔ.ʃɔ.pe"),
    (("shawarma",), "ʃa.waʁ.ma"),
    (("Washing_tonne",), "wa.ʃiŋ.tɔn"),
    # T:
    (("tôt",), "to"),
    (("yaourte",), "ja.uʁt"),
    (("zute",), "zyt"),
    (("brute",), "bʁyt"),
    (("thème",), "tɛm"),
    (("anette",), "a.nɛt"),
    (("asme",), "asm"),
    (("bizut",), "bi.zy"),
    (("nation",), "na.sjɔ̃"),
    (("iniciation",), "i.ni.sja.sjɔ̃"),
    (("Crôacie",), "kʁo.a.si"),
    (("haïtien",), "a.i.sjɛ̃"),
    (("bastion",), "bas.tjɔ̃"),
    (("gestionnaire",), "ʒɛs.tjɔ.nɛʁ"),
    (("tiens",), "tjɛ̃"),
    (("aqué-sextien",), "a.ke.sɛk.stjɛ̃"),
    (("portions",), "pɔʁ.sjɔ̃"),
    (("portions", "v"), "pɔʁ.tjɔ̃"),
    (("conditionner", "v"), "kɔ̃.di.sjɔ.ne"),
    (("ouest pour",), "wɛst puʁ"),
    (("est",), "ɛ"),
    (("c'est",), "s‿ɛ"),
    # U:
    (("juge",), "ʒyʒ"),
    (("huite",), "ɥit"),
    (("tuer",), "tɥe"),
    (("tofou",), "tɔ.fu"),
    (("actuel",), "ak.tɥɛl"),
    (("rue",), "ʁy"),
    (("bruit",), "bʁɥi"),
    (("truelle",), "tʁy.ɛl"),
    (("influir",), "ɛ̃.flɥiʁ"),
    (("continuions",), "kɔ̃.ti.ny.jɔ̃"),
    (("ennuyons",), "ɑ̃.nɥi.jɔ̃"),
    (("ennuierez",), "ɑ̃.nɥi.ʁe"),
    # Û:
    (("sûr",), "syʁ"),
    (("flûte",), "flyt"),
    # V:
    (("vague",), "vaɡ"),
    (("grave",), "ɡʁav"),
    # W:
    (("kiwi",), "ki.wi"),
    (("wik-e_nde",), "wi.kɛnd"),
    (("wiski",), "wis.ki"),
    (("vagon",), "va.ɡɔ̃"),
    (("cloune",), "klun"),
    (("cau-boille",), "ko.bɔj"),
    (("wallon",), "wa.lɔ̃"),
    (("chau",), "ʃo"),
    # X:
    (("xylophone",), "ɡzi.lɔ.fɔn"),
    (("expansion",), "ɛk.spɑ̃.sjɔ̃"),
    (("exigence",), "ɛɡ.zi.ʒɑ̃s"),
    (("soissante",), "swa.sɑ̃t"),
    (("deusième",), "dø.zjɛm"),
    (("galacsie",), "ɡa.lak.si"),
    (("paix",), "pɛ"),
    (("deux",), "dø"),
    (("animaux",), "a.ni.mo"),
    (("genoux",), "ʒə.nu"),
    (("sexe",), "sɛks"),
    (("indexe",), "ɛ̃.dɛks"),
    (("pharynxe",), "fa.ʁɛ̃ks"),
    (("sisse",), "sis"),
    (("disse",), "dis"),
    (("coccysse",), "kɔk.sis"),
    (("exciter",), "ɛk.si.te"),
    # Y:
    (("péiller",), "pe.je"),
    (("yeux",), "jø"),
    (("paye",), "pɛj"),
    (("paie",), "pɛ"),
    (("payions",), "pɛj.jɔ̃"),
    (("ennuie",), "ɑ̃.nɥi"),
    (("ennuye",), "ɑ̃.nɥij"),
    (("hyène",), "jɛn"),
    (("cyclône",), "si.klon"),
    (("style",), "stil"),
    (("boillcotter",), "bɔj.kɔ.te"),
    # Z:
    (("zain",), "zɛ̃"),
    (("gazette",), "ɡa.zɛt"),
    (("chez",), "ʃe"),
    (("nez",), "ne"),
    (("gâze",), "ɡɑz"),
    # Hyphenation: (see also cases above and below),
    (("arc-en-ciel",), "aʁ.kɑ̃.sjɛl"),
    (("ci-dəssus",), "si.d(ə).sy"),
    (("quatre-vingt-un",), "ka.tʁə.vɛ̃.œ̃"),
    (("puis-je",), "pɥi.ʒə"),
    (("quelle-heure-est‿il",), "kɛ.lœ.ʁɛ.t‿il"),
    (("parles-tu",), "paʁ.l(ə).ty"),
    (("montres-tu",), "mɔ̃.tʁə.ty"),
    (("croyez-le ou non",), "kʁwa.je.lə u nɔ̃"),
    (("contre-attaquer",), "kɔ̃.tʁa.ta.ke"),
    (("ouest-quart-sude-ouest",), "wɛst.kaʁ.sy.dwɛst"),
    # Comma:
    (("bras dəssus, bras dəssous",), "bʁɑ d(ə).sy | bʁɑ d(ə).su"),
    (("au royaume des‿aveugles, les borgnes sont rois",), "o ʁwa.jom de.z‿a.vœɡl | le bɔʁ.ɲ(ə) sɔ̃ ʁwa"),
    # Liaison:
    (("grand‿arbre",), "ɡʁɑ̃.t‿aʁbʁ"),
    (("pied‿à-terre",), "pje.t‿a.tɛʁ"),
    (("quelle‿heure‿est‿il",), "kɛ.l‿œ.ʁ‿ɛ.t‿il"),
    (("neuf‿ans",), "nœ.v‿ɑ̃"),
    (("long‿article",), "lɔ̃.ɡ‿aʁ.tikl"),
    (("genti‿enfant",), "ʒɑ̃.ti.j‿ɑ̃.fɑ̃"),
    (("s'en‿aller",), "s‿ɑ̃.n‿a.le"),
    (("certain‿ami",), "sɛʁ.tɛ.n‿a.mi"),
    (("bon‿ami",), "bɔ.n‿a.mi"),
    (("mon‿ami",), "mɔ̃.n‿a.mi"),
    (("un‿ami",), "œ̃.n‿a.mi"),
    (("qu'on‿apprend",), "k‿ɔ̃.n‿a.pʁɑ̃"),
    (("l'on‿apprend",), "l‿ɔ̃.n‿a.pʁɑ̃"),
    (("trop‿èlevé",), "tʁo.p‿ɛl.ve"),
    (("beaucoup‿appris",), "bo.ku.p‿a.pʁi"),
    (("premier‿étage",), "pʁə.mjɛ.ʁ‿e.taʒ"),
    (("premiers‿étages",), "pʁə.mje.z‿e.taʒ"),
    (("les‿enfants",), "le.z‿ɑ̃.fɑ̃"),
    (("vous‿avez",), "vu.z‿a.ve"),
    (("de plus‿en plus",), "də ply.z‿ɑ̃ ply"),
    (("de temps‿en temps",), "də tɑ̃.z‿ɑ̃ tɑ̃"),
    (("peut‿être",), "pø.t‿ɛtʁ"),
    (("dort‿il", "v"), "dɔʁ.t‿il"),
    (("parlent‿ils", "v"), "paʁ.l(ə).t‿il"),
    (("jouent‿ils", "v"), "ʒu.t‿il"),
    (("tout‿homme",), "tu.t‿ɔm"),
    (("faux‿amis",), "fo.z‿a.mi"),
    (("y‿a‿t‿il",), "i.j‿a‿.t‿il"),
    (("il n'y‿a",), "il n‿j‿a"),
    (("venez‿ici",), "və.ne.z‿i.si"),
    (("des‿yeux",), "de.z‿jø"),
]


class TestFrPronMeta(type):
    """TestFrPron meta class
    """
    def __new__(mcs, name, bases, dicts):
        def gen_test_fr_to_IPA(fr_args, fr_IPA):
            """Generate fr text and pos to IPA testcases.

            Parameters
            ----------
            fr_args : tuple
                Tuple of French text and pos in {{fr-IPA}} template
                parsed from Wiktionary.
            fr_IPA : string
                String of expected French IPA after conversion.

            Returns
            -------
            test: function
                AssertEqual of two texts.
            """
            def test(self):
                """AssertEqual of fr text and converted IPA.
                """
                return self.assertEqual(
                    fr_pron.to_IPA(*fr_args),
                    fr_IPA
                )
            return test

        for i, (fr_args, fr_IPA) in enumerate(TESTCASES):
            test_fr_to_IPA_name = "test_fr_to_IPA_%06d" % i
            dicts[test_fr_to_IPA_name] = \
                gen_test_fr_to_IPA(fr_args, fr_IPA)
        return type.__new__(mcs, name, bases, dicts)


class TestFrPron(with_metaclass(TestFrPronMeta, unittest.TestCase)):
    """TestFrPron class
    """
    pass


if __name__ == "__main__":
    unittest.main()
