from taibun.taibun import Converter
from utils import checker, bilabial_c, alveolar_c, alveolo_palatal_c, velar_c, front_c, central_c, back_c, nasal_c, stop_c, syllabic_c, additional_c

c = Converter(system="TLPA", punctuation='none')
c_north = Converter(system="TLPA", dialect="north", punctuation='none')

def test_tlpa_initials():
    bilabial = ['pi1','pho1','moo5','ba5']
    checker(list(zip(bilabial_c, bilabial)), c, c_north)
    alveolar = ['te7/tue7','tho3','ca2','chu3','su1','nai7','ju5/lu5','liu2']
    checker(list(zip(alveolar_c, alveolar)), c, c_north)
    alveolo_palatal = ['cia1','chiu2','sia2','ji5/li5']
    checker(list(zip(alveolo_palatal_c, alveolo_palatal)), c, c_north)
    velar = ['kiu5','khi3','nga2','gi2/gu2','hi2']
    checker(list(zip(velar_c, velar)), c, c_north)

def test_tlpa_vowels_and_rhymes():
    front = ['i1','e7','inn5','enn5']
    checker(list(zip(front_c, front)), c, c_north)
    central = ['o1','a1','ann7']
    checker(list(zip(central_c, central)), c, c_north)
    back = ['u2','oo1','tiunn1','onn1']
    checker(list(zip(back_c, back)), c, c_north)

def test_tlpa_finals():
    nasal = ['im1','in5','ang5']
    checker(list(zip(nasal_c, nasal)), c, c_north)
    stop = ['iap8','at4','ok4','ah8']
    checker(list(zip(stop_c, stop)), c, c_north)
    syllabic = ['m2','ng5']
    checker(list(zip(syllabic_c, syllabic)), c, c_north)

def test_tlpa_syllables_additional():
    additional = ["cann7","it4 khai3","sam1 can3","put4 sut4","thiu2","tom5","honnh0","khit4 ciah8","luan7 cing1","ka1 lauh8","jin5 kan1/lin5 kan1","giong2 kak4","hiu1 khik4","bu2 jiok8/bu2 liok8","thing5 tian7","ainn7/iang7","thuan5 ciap4","hiau1 hing7","giam2 nge7/giam2 ngi7","hiann1 ko1","chiong1 cok4","bian2 hui3","jip8 khau2/lip8 khau2","pat4 sian1","peh4 gueh8 ceh4/pueh4 geh8 cueh4","phann3 phuh8","ping1 phauh8","tainn2","phuann3 tuan3","piat8 cong1","kueh4/kuih4","thak4 thik4","kat4 le2","ueh8/uih8","ka1 khuai3","luat8","kiap4 kuan1","chong1 chiok4","phit4 tik8","puan3 sui7","hiap8 ho5","khah4 phinn3","bau2 mia5","mauh4 loh8 khi3","gui5 hiam2","nng7 pau1","cham1 ciau3","hap8 huan1","ham5 thiok4","khngh4","khip4 kuann7","bun2 chio3","eh4 sng1","khuh4","phin2 siong5","hah4 chiunn3","ha1 khui3","hainn1 chan1","haih4","khennh8","nauh4","iaunn1","ooh0","huah4 ling7","sannh4","phngh4","cak8","chauh8 chauh8 liam7","hau1 siau5","uh4","aih4","hmh8","heh4 kiann1","chiak8","jiang2/liong2","uang1","tun2 tiah8","khun3 kiok8","inn5 som1","cai7","thun7 thoo5","khenn1 kok4/khinn1 kok4","ing1 ia1","lah4 sap4","ki1 kim1","giau5 ku2","thap4 the3/thap4 thue3","piah4 ue7","ap4 boo5","gue7 sing1","Tua7 suann1","thinn1 kng1","thian1 hio7","Thai3 loo2 koh4","iang1 kip8","khia1 siang1","phun1 song1","honn3 kheh4","miau7","cng1 thann7","chiap4","senn3/sinn3","ma1 ma1","pu7","hak8 hng5","oh8 phainn2/oh8 phai2","giat8","theh8","an1 bin5","kia3 lai5","bat8 cat8","cuan1 uan5","jio7 koo2/lio7 koo2","phui3","kai3 si5","khut4 kio5","pin5 cia1 na2","kiah8","gam5 iam5","gak8 hu7","ni5 pio2","tiam3 coo1","am1 bio7","jiap8/liap8","piu1","hit4 iunn7","khio3","jim2 sim1/lim2 sim1","khuinn3 uah8","hut4 jian5/hut4 lian5","phenn7","khiap4 tann2","khiong2 ui3","sioh4 lioh8","gok8","gang7","cheh4 sim1/chueh4 sim1","tan7","noo7","huai5 liam7","gong7","pe1 png7","ngiu2 kha1 chng1","jiau3 ciunn7/liau3 ciunn7","phi1 tiann5","buah4 hun2","khioh4 sip8","thiah4 tuann5","phau1 chut4","pha1 sa1","phah4 chap4","thua1 tit8","cio1 ua2","kuah4 lau5","cainn2","tha3","hinn3 sak4","ai1 go7","hian1 cheh4","sau3 tong7","tuah4","ciann7","om1 bak8 ke1/om1 bak8 kue1","chah4 chun1","tuh8","tiuh4","tah4 hiannh4","Tah4 li2 bu7","khaunnh8","phiat4 ching1","ngiau2","thiat4 cit4","tiak8","tam1 tng1","phiak8","phan1 ting1","nua5 cah8","khainn2","thin5 ciu2","hong1 hing1 bi7 ngai7","coh8","buan2 hue7/buan2 he7","cenn5/cinn5","ne5","khiok4 suann3","long2 thok8","bok8 giap8","buat8 loo7","thu2","kuai2","jiam2/liam2","kau3 uat8","hik8 kho2","toh4 thuah4","jiu5/liu5","piau1 pun2","phoh4 sit8","huainn5 keh8/huinn5 keh8","suainn7","suh4","hioh4 iann2","kua1 phoo2","huann1 too7","uai1 chuah8","mui2 pai2","ak4 hoo7","tim5 tiok8","but8 ioh8","tauh8","tap8 tih4","chiang5 cui2","phueh8/pheh8","hai2 he7","liang5 khiong1","thiam1 siat4","biau2 bong5","thuann3 cang5","biat8 bo5","phiau1 phu5","lok4 sai2","au1 pui5","ciang1","phuah4 sinn3","phuat4 cian7","jun7 piann2/lun7 piann2","haunnh8","kik4 lat8","cuann7","piak4","sah8","mue5","hannh4","him5","jiat8 liat8/liat8 liat8","nah4","tia1","thenn3","giu5 chik4","mih8/mngh8","mih4 tai7","khian1 kiong5","khan1 khap8","bing2 iong2","gik8 khuan5","giok8 lan5","guan2 khu7","kam1 khoo2","lut4 mng5","han1 ci5/han1 cu5","thiap8 ciam1","soo1 san3","gian3 kah4","pah4 puann1","ik4 thiong5","iah4 koh4","kann1 lo5","sio1 siam2","bai5 hiah8","khuann3","hin5 sua1","chuh4","gan2 hok4","kainn5","tok4 chat4","kheh4/khueh4","kih4","ging2 puah4","phua3 khih4","teh4","uann2 thau5 ti7 bue2/uann2 thau5 tu7 be2","phik4 tham5","khak4 po2","bua5 khann1","ta1 cioh8","choo2","gai7 tioh8","phio3 siunn1","thut4","khang1 khang1","tut8","leh8/lueh8","pit4 suan3","chok4","pua3","chiam1 ong5","liap8","khng1 chng1","thio3","tiu7","lap8 chai2","soh4 thui1","lui2 cik4","khong2","kiat4 pa1","cuat8 tui3","jiong5 poo3/liong5 poo3","kenn1 kian2/kinn1 kian2","lik8 sik4","chip4 poo2","thong7","pian1 chuan3","khuat4 niu5","bi2 bi7","hip4 juah8/hip4 luah8","phing3 chiann2","thiann1 cho3","bah4 bak8","meh8 phok4","thuat4 ciat4","khiunn1 tiau7","io1 kut4","kioh4 cinn5","cun5 un7","sik4 ga5","mau5 chau2","chau2 leh8 a2/chau2 lueh8 a2","ngeh4","lak4 loh8","chioh8","chang1 ngau7","kueh4 niau1","pok8 thai7","poh8 mooh8","kiunn1","hiauh4","phuan1 pin5","khing7","cuah8","kap4 la5","siok8 chit4","gia5 kang1","bit8 guat8","sih8 chin3","bui1","sat4","gio5 pue1","ngiauh8 ngiauh8 tang7","cim5","than1 phiann5","bang2 tau3","chih8","ban5 phue5 penn7/ban5 phe5 pinn7","hueh4 iu5/huih4 iu5","hiat4 ian5","lih8 phang7","liah4 khiah4","thng3","thi2 tuat8","khim1 ciong1","bueh8 sok4","kui1 me5/kui1 mi5","bih4 chui3","tak4 tinn5","kuat4 suat4","khiat4 cih8","khua1 tiong1","tiap8","gioh8 siah4","pong3 tua7","khiam1 sun3","biu7 goo7","hooh4","phong1 phai3","mai2 ciok4","lua7","chiah4 cin2","chiau1 chi7","so5","puat8 siap8","jiah4/liah4","kha1 khiau1","cuainn7","thiau3 that4","phih4 to2","neh4/nih4","khin1 siann1 se3 sueh4/khin1 siann1 sue3 seh4","hat4 king2","phik4 cau2","ngia5 sin5","hann7","pik4 chiat4","tiat8","piang3","sang3 tat8","cua7","jia1 kham3/lia1 kham3","iau1 iok4","ip4","na2 thang1","hiok4","tenn7","khok4 lang5","tang7 chenn1/tang7 chinn1","tio3 co5","gin5 huat4/gun5 huat4","jue7 kiam2/lue7 kiam2","chann7","gim2 siu3","tin3 suah4","cam7","thih4 thah4","siak4","chim5","chak8","chuann3","iat8 lam2","khuah4 pak4","chuang3","kuainn1 chia1/kuinn1 chia1","chian2","a1 sa1 puh4 luh4","ham7","cap8 cha5","ke1 ce5 kin1/kue1 cue5 kun1","hia1 kong2","hang7","nia2 pan1","giah8 gua7","hong1 chue1 jit8 phak8/hong1 che1 lit8 phak8","hiunn1","hiang1 hm5","hiong1 hua1","phian3","kiau1 ngoo7","nau7 pang5","ut4 cut4","thoh4","pih4","thim1","hoh8","beh8 ge5","mua5 sann1","bik8 khe3/bik8 khue3","thuh4","giang3","phiang7","gau5","cip8","khat4","chua7","choh4","phut8","uainn2","khiu7","kauh4"]
    checker(list(zip(additional_c, additional)), c, c_north)