from taibun.taibun import Converter
from utils import checker

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(bilabial, c, c_north)
    alveolar = ["地,te7/tue7","唾,tho3","早,ca2","厝,chu3","思,su1","耐,nai7","如,ju5/lu5","柳,liu2"]
    checker(alveolar, c, c_north)
    alveolo_palatal = ["遮,cia1","手,chiu2","寫,sia2","而,ji5/li5"]
    checker(alveolo_palatal, c, c_north)
    velar = ["求,kiu5","去,khi3","雅,nga2","語,gi2/gu2","喜,hi2"]
    checker(velar, c, c_north)

def test_tlpa_vowels_and_rhymes():
    front = ["衣,i1","會,e7","圓,inn5","楹,enn5"]
    checker(front, c, c_north)
    central = ["阿,o1","亞,a1","餡,ann7"]
    checker(central, c, c_north)
    back = ["禹,u2","烏,oo1","張,tiunn1","唔,onn1"]
    checker(back, c, c_north)

def test_tlpa_finals():
    nasal = ["音,im1","寅,in5","紅,ang5"]
    checker(nasal, c, c_north)
    stop = ["葉,iap8","楬,at4","惡,ok4","曷,ah8"]
    checker(stop, c, c_north)
    syllabic = ["姆,m2","黃,ng5"]
    checker(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","孽,giat8","宅,theh8","安眠,an1 bin5","寄來,kia3 lai5","密實,bat8 cat8","專員,cuan1 uan5","尿鈷,jio7 koo2/lio7 koo2","屁,phui3","屆時,kai3 si5","屈橋,khut4 kio5","屏遮那,He3 sen1 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","搭里霧,Ta7 li2 buh4","摳,khaunnh8","撇清,phiat4 ching1","撓,ngiau2","撤職,thiat4 cit4","擉,tiak8","擔當,tam1 tng1","擗,phiak8","攀登,phan1 ting1","攔閘,nua5 cah8","敱,khainn2","斟酒,thin5 ciu2","方興未艾,hong1 hing1 bi7 ngai7","昨,coh8","晚會,buan2 hue7","晴,cenn5","晾,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 khiang1","添設,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","筆算,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","辟走,phiah4 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(additional, c, c_north)