from taibun.taibun import Converter
from utils import checker

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

def test_tailo_initials():
    bilabial = ["啡,pi","波,pho","毛,môo","猫,bâ"]
    checker(bilabial, c, c_north)
    alveolar = ["地,tē/tuē","唾,thò","早,tsá","厝,tshù","思,su","耐,nāi","如,jû/lû","柳,liú"]
    checker(alveolar, c, c_north)
    alveolo_palatal = ["遮,tsia","手,tshiú","寫,siá","而,jî/lî"]
    checker(alveolo_palatal, c, c_north)
    velar = ["求,kiû","去,khì","雅,ngá","語,gí/gú","喜,hí"]
    checker(velar, c, c_north)

def test_tailo_vowels_and_rhymes():
    front = ["衣,i","會,ē","圓,înn","楹,ênn"]
    checker(front, c, c_north)
    central = ["阿,o","亞,a","餡,ānn"]
    checker(central, c, c_north)
    back = ["禹,ú","烏,oo","張,tiunn","唔,onn"]
    checker(back, c, c_north)

def test_tailo_finals():
    nasal = ["音,im","寅,în","紅,âng"]
    checker(nasal, c, c_north)
    stop = ["葉,ia̍p","楬,at","惡,ok","曷,a̍h"]
    checker(stop, c, c_north)
    syllabic = ["姆,ḿ","黃,n̂g"]
    checker(syllabic, c, c_north)

def test_tailo_syllables_additional():
    additional = ["㨻,tsānn","一概,it-khài","三層,sam-tsàn","不屑,put-sut","丑,thiú","丼,tôm","乎,--honnh","乞食,khit-tsia̍h","亂鐘,luān-tsing","交落,ka-la̍uh","人間,jîn-kan/lîn-kan","仰角,gióng-kak","休克,hiu-khik","侮辱,bú-jio̍k/bú-lio̍k","停電,thîng-tiān","偝,āinn/iāng","傳接,thuân-tsiap","僥倖,hiau-hīng","儼硬,giám-ngē/giám-ngī","兄哥,hiann-ko","充作,tshiong-tsok","免費,bián-huì","入口,ji̍p-kháu/li̍p-kháu","八仙,pat-sian","八月節,peh-gue̍h-tseh/pueh-ge̍h-tsueh","冇浡,phànn-phu̍h","冰雹,ping-pha̍uh","刐,táinn","判斷,phuànn-tuàn","別莊,pia̍t-tsong","刮,kueh/kuih","剔斥,thak-thik","割禮,kat-lé","劃,ue̍h/ui̍h","加快,ka-khuài","劣,lua̍t","劫棺,kiap-kuan","匆促,tshong-tshiok","匹敵,phit-ti̍k","半遂,puàn-suī","協和,hia̍p-hô","卡片,khah-phìnn","卯名,báu-miâ","卯落去,mauh-lo̍h-khì","危險,guî-hiám","卵包,nn̄g-pau","參照,tsham-tsiàu","合歡,ha̍p-huan","含蓄,hâm-thiok","吭,khngh","吸汗,khip-kuānn","吻笑,bún-tshiò","呃酸,eh-sng","呿,khuh","品嘗,phín-siông","哈啾,hah-tshiùnn","哈氣,ha-khuì","哼呻,hainn-tshan","唉,haih","喀,khe̍nnh","喃,nauh","喓,iaunn","喔,--ooh","喝令,huah-līng","喢,sannh","嗙,phngh","嗾,tsa̍k","嘈嘈唸,tsha̍uh-tsha̍uh-liām","嘐潲,hau-siâu","噎,uh","噯,aih","噷,hm̍h","嚇驚,heh-kiann","嚓,tshia̍k","嚷,jiáng/lióng","嚾,uang","囤糴,tún-tia̍h","困局,khùn-kio̍k","圓參,înn-som","在,tsāi","坉塗,thūn-thôo","坑谷,khenn-kok/khinn-kok","坱埃,ing-ia","垃圾,lah-sap","基金,ki-kim","堯韭,giâu-kú","塌替,thap-thè/thap-thuè","壁畫,piah-uē","壓模,ap-bôo","外甥,guē-sing","大山,Tuā-suann","天光,thinn-kng","天后,thian-hiō","太魯閣,Thài-lóo-koh","央及,iang-ki̍p","奇雙,khia-siang","奔喪,phun-song","好客,hònn-kheh","妙,miāu","妝娗,tsng-thānn","妾,tshiap","姓,sènn/sìnn","媽媽,ma-ma","孵,pū","學園,ha̍k-hn̂g","學歹,o̍h-pháinn","孽,gia̍t","宅,the̍h","安眠,an-bîn","寄來,kià-lâi","密實,ba̍t-tsa̍t","專員,tsuan-uân","尿鈷,jiō-kóo/liō-kóo","屁,phuì","屆時,kài-sî","屈橋,khut-kiô","屏遮那,Hè-sen-ná","屐,kia̍h","岩鹽,gâm-iâm","岳父,ga̍k-hū","年表,nî-pió","店租,tiàm-tsoo","庵廟,am-biō","廿,jia̍p/lia̍p","彪,piu","彼樣,hit-iūnn","徼,khiò","忍心,jím-sim/lím-sim","快活,khuìnn-ua̍h","忽然,hut-jiân/hut-liân","怦,phēnn","怯膽,khiap-tánn","恐畏,khióng-uì","惜略,sioh-lio̍h","愕,go̍k","愣,gāng","慼心,tsheh-sim/tshueh-sim","憚,tān","懦,nōo","懷念,huâi-liām","戇,gōng","扒飯,pe-pn̄g","扭尻川,ngiú-kha-tshng","抓癢,jiàu-tsiūnn/liàu-tsiūnn","披埕,phi-tiânn","抹粉,buah-hún","抾拾,khioh-si̍p","拆壇,thiah-tuânn","拋出,phau-tshut","拋捎,pha-sa","拍插,phah-tshap","拖直,thua-ti̍t","招倚,tsio-uá","括流,kuah-lâu","指,tsáinn","挓,thà","挕捒,hìnn-sak","挨餓,ai-gō","掀冊,hian-tsheh","掃蕩,sàu-tōng","掇,tuah","掙,tsiānn","掩目雞,om-ba̍k-ke/om-ba̍k-kue","插春,tshah-tshun","揬,tu̍h","搐,tiuh","搭嚇,tah-hiannh","搭里霧,Tā-lí-buh","摳,kha̍unnh","撇清,phiat-tshing","撓,ngiáu","撤職,thiat-tsit","擉,tia̍k","擔當,tam-tng","擗,phia̍k","攀登,phan-ting","攔閘,nuâ-tsa̍h","敱,kháinn","斟酒,thîn-tsiú","方興未艾,hong-hing-bī-ngāi","昨,tso̍h","晚會,buán-huē","晴,tsênn","晾,nê","曲線,khiok-suànn","朗讀,lóng-tho̍k","木業,bo̍k-gia̍p","末路,bua̍t-lōo","杵,thú","枴,kuái","染,jiám/liám","校閱,kàu-ua̍t","核可,hi̍k-khó","桌屜,toh-thuah","榆,jiû/liû","標本,piau-pún","樸實,phoh-si̍t","橫扴,huâinn-ke̍h/huînn-ke̍h","檨,suāinn","欶,suh","歇影,hioh-iánn","歌譜,kua-phóo","歡度,huann-tōo","歪斜,uai-tshua̍h","每擺,muí-pái","沃雨,ak-hōo","沉著,tîm-tio̍k","沒藥,bu̍t-io̍h","沓,ta̍uh","沓滴,ta̍p-tih","沖水,tshiâng-tsuí","沫,phue̍h/phe̍h","海蟹,hái-hē","涼腔,liâng-khiang","添設,thiam-siat","渺茫,biáu-bông","湠叢,thuànn-tsâng","滅無,bia̍t-bô","漂浮,phiau-phû","漉屎,lok-sái","漚肥,au-puî","漳,tsiang","潑扇,phuah-sìnn","潑賤,phuat-tsiān","潤餅,jūn-piánn/lūn-piánn","澩,ha̍unnh","激力,kik-la̍t","濺,tsuānn","煏,piak","煠,sa̍h","煤,muê","熁,hannh","熊,hîm","熱烈,jia̍t-lia̍t/lia̍t-lia̍t","爁,nah","爹,tia","牚,thènn","牛膝,giû-tshik","物,mi̍h/mn̍gh","物代,mih-tāi","牽強,khian-kiông","牽磕,khan-kha̍p","猛勇,bíng-ióng","玉環,gi̍k-khuân","玉蘭,gio̍k-lân","玩具,guán-khū","甘苦,kam-khóo","甪毛,lut-mn̂g","番薯,han-tsî/han-tsû","疊尖,thia̍p-tsiam","疏散,soo-sàn","癮甲,giàn-kah","百般,pah-puann","益蟲,ik-thiông","益閣,iah-koh","監牢,kann-lô","相閃,sio-siám","眉額,bâi-hia̍h","看,khuànn","眩痧,hîn-sua","眵,tshuh","眼福,gán-hok","睚,kâinn","督察,tok-tshat","瞌,kheh/khueh","砌,kih","研缽,gíng-puah","破缺,phuà-khih","硩,teh","碗頭箸尾,uánn-thâu-tī-bué/uánn-thâu-tū-bé","碧潭,phik-thâm","確保,khak-pó","磨坩,buâ-khann","礁石,ta-tsio̍h","礎,tshóo","礙著,gāi-tio̍h","票箱,phiò-siunn","禿,thut","空空,khang-khang","突,tu̍t","笠,le̍h","筆算,pit-suàn","簇,tshok","簸,puà","籤王,tshiam-ông","粒,lia̍p","糠瘡,khng-tshng","糶,thiò","紂,tiū","納采,la̍p-tshái","索梯,soh-thui","累積,luí-tsik","紺,khóng","結疤,kiat-pa","絕對,tsua̍t-tuì","絨布,jiông-pòo/liông-pòo","經繭,kenn-kián/kinn-kián","綠色,li̍k-sik","緝捕,tship-póo","緟,thōng","編篡,pian-tshuàn","缺糧,khuat-niû","美味,bí-bī","翕熱,hip-jua̍h/hip-lua̍h","聘請,phìng-tshiánn","聽錯,thiann-tshò","肉目,bah-ba̍k","脈搏,me̍h-phok","脫節,thuat-tsiat","腔調,khiunn-tiāu","腰骨,io-kut","腳錢,kioh-tsînn","船運,tsûn-ūn","色牙,sik-gâ","茅草,mâu-tsháu","草笠仔,tsháu-le̍h-á/tsháu-lue̍h-á","莢,ngeh","落落,lak-lo̍h","蓆,tshio̍h","蔥藕,tshang-ngāu","蕨貓,kueh-niau","薄待,po̍k-thāi","薄膜,po̍h-mo̍oh","薑,kiunn","藃,hiauh","藩屏,phuan-pîn","虹,khīng","蚻,tsua̍h","蛤蜊,kap-lâ","蜀七,sio̍k-tshit","蜈蚣,giâ-kang","蜜月,bi̍t-gua̍t","蝕秤,si̍h-tshìn","蝛,bui","蝨,sat","蟯桮,giô-pue","蟯蟯動,ngia̍uh-ngia̍uh-tāng","蟳,tsîm","蟶坪,than-phiânn","蠓罩,báng-tàu","蠘,tshi̍h","蠻皮病,bân-phuê-pēnn/bân-phê-pīnn","血油,hueh-iû/huih-iû","血緣,hiat-iân","裂縫,li̍h-phāng","裂隙,liah-khiah","褪,thǹg","褫奪,thí-tua̍t","襟章,khim-tsiong","襪束,bue̍h-sok","規暝,kui-mê/kui-mî","覕喙,bih-tshuì","觸纏,tak-tînn","訣說,kuat-suat","詰舌,khiat-tsi̍h","誇張,khua-tiong","諜,tia̍p","謔削,gio̍h-siah","謗大,pòng-tuā","謙遜,khiam-sùn","謬誤,biū-gōo","謼,hooh","豐沛,phong-phài","買囑,mái-tsiok","賴,luā","赤疹,tshiah-tsín","超市,tshiau-tshī","趖,sô","跋涉,pua̍t-sia̍p","跡,jiah/liah","跤曲,kha-khiau","跩,tsuāinn","跳躂,thiàu-that","躄倒,phih-tó","躡,neh/nih","輕聲細說,khin-siann-sè-sueh/khin-siann-suè-seh","轄境,hat-kíng","辟走,phiah-tsáu","迎神,ngiâ-sîn","迒,hānn","迫切,pik-tshiat","迭,tia̍t","迸,piàng","送達,sàng-ta̍t","逝,tsuā","遮勘,jia-khàm/lia-khàm","邀約,iau-iok","邑,ip","那通,ná-thang","郁,hiok","鄭,tēnn","酷人,khok-lâng","重青,tāng-tshenn/tāng-tshinn","釣艚,tiò-tsô","銀髮,gîn-huat/gûn-huat","銳減,juē-kiám/luē-kiám","錚,tshānn","錦繡,gím-siù","鎮煞,tìn-suah","鏨,tsām","鐵塔,thih-thah","鑠,siak","鑱,tshîm","鑿,tsha̍k","閂,tshuànn","閱覽,ia̍t-lám","闊腹,khuah-pak","闖,tshuàng","關車,kuainn-tshia/kuinn-tshia","闡,tshián","阿沙不魯,a-sa-puh-luh","陷,hām","雜柴,tsa̍p-tshâ","雞齊根,ke-tsê-kin/kue-tsuê-kun","靴管,hia-kóng","項,hāng","領班,niá-pan","額外,gia̍h-guā","風吹日曝,hong-tshue-ji̍t-pha̍k/hong-tshe-li̍t-pha̍k","香,hiunn","香茅,hiang-hm̂","香華,hiong-hua","騙,phiàn","驕傲,kiau-ngōo","鬧房,nāu-pâng","鬱卒,ut-tsut","魠,thoh","鱉,pih","鴆,thim","鶴,ho̍h","麥牙,be̍h-gê","麻衫,muâ-sann","默契,bi̍k-khè/bi̍k-khuè","黜,thuh","齴,giàng","龐,phiāng","𠢕,gâu","𠯗,tsi̍p","𣁳,khat","𤆬,tshuā","𧮙,tshoh","𧿳,phu̍t","𨂿,uáinn","𩚨,khiū","𩛩,kauh"]
    checker(additional, c, c_north)