from taibun.taibun import Converter
from utils import checker

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

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

def test_poj_vowels_and_rhymes():
    front = ["衣,i","會,ē","圓,îⁿ","楹,êⁿ"]
    checker(front, c, c_north)
    central = ["阿,o","亞,a","餡,āⁿ"]
    checker(central, c, c_north)
    back = ["禹,ú","烏,o͘","張,tiuⁿ","唔,oⁿ"]
    checker(back, c, c_north)

def test_poj_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_poj_syllables_additional():
    additional = ["㨻,chāⁿ","一概,it-khài","三層,sam-chàn","不屑,put-sut","丑,thiú","丼,tôm","乎,--hohⁿ","乞食,khit-chia̍h","亂鐘,loān-cheng","交落,ka-la̍uh","人間,jîn-kan/lîn-kan","仰角,gióng-kak","休克,hiu-khek","侮辱,bú-jio̍k/bú-lio̍k","停電,thêng-tiān","偝,āiⁿ/iāng","傳接,thoân-chiap","僥倖,hiau-hēng","儼硬,giám-ngē/giám-ngī","兄哥,hiaⁿ-ko","充作,chhiong-chok","免費,bián-hùi","入口,ji̍p-kháu/li̍p-kháu","八仙,pat-sian","八月節,peh-goe̍h-cheh/poeh-ge̍h-choeh","冇浡,phàⁿ-phu̍h","冰雹,peng-pha̍uh","刐,táiⁿ","判斷,phoànn-toàn","別莊,pia̍t-chong","刮,koeh/kuih","剔斥,thak-thek","割禮,kat-lé","劃,oe̍h/u̍ih","加快,ka-khoài","劣,loa̍t","劫棺,kiap-koan","匆促,chhong-chhiok","匹敵,phit-te̍k","半遂,poàn-sūi","協和,hia̍p-hô","卡片,khah-phìⁿ","卯名,báu-miâ","卯落去,mauh-lo̍h-khì","危險,gûi-hiám","卵包,nn̄g-pau","參照,chham-chiàu","合歡,ha̍p-hoan","含蓄,hâm-thiok","吭,khngh","吸汗,khip-koānn","吻笑,bún-chhiò","呃酸,eh-sng","呿,khuh","品嘗,phín-siông","哈啾,hah-chhiùⁿ","哈氣,ha-khùi","哼呻,haiⁿ-chhan","唉,haih","喀,khe̍hⁿ","喃,nauh","喓,iauⁿ","喔,--o͘h","喝令,hoah-lēng","喢,sahⁿ","嗙,phngh","嗾,cha̍k","嘈嘈唸,chha̍uh-chha̍uh-liām","嘐潲,hau-siâu","噎,uh","噯,aih","噷,hm̍h","嚇驚,heh-kiaⁿ","嚓,chhia̍k","嚷,jiáng/lióng","嚾,oang","囤糴,tún-tia̍h","困局,khùn-kio̍k","圓參,îⁿ-som","在,chāi","坉塗,thūn-thô͘","坑谷,kheⁿ-kok/khiⁿ-kok","坱埃,eng-ia","垃圾,lah-sap","基金,ki-kim","堯韭,giâu-kú","塌替,thap-thè/thap-thòe","壁畫,piah-ōe","壓模,ap-bô͘","外甥,gōe-seng","大山,Tōa-soann","天光,thiⁿ-kng","天后,thian-hiō","太魯閣,Thài-ló͘-koh","央及,iang-ki̍p","奇雙,khia-siang","奔喪,phun-song","好客,hòⁿ-kheh","妙,miāu","妝娗,chng-thāⁿ","妾,chhiap","姓,sèⁿ/sìⁿ","媽媽,ma-ma","孵,pū","學園,ha̍k-hn̂g","學歹,o̍h-pháiⁿ","孽,gia̍t","宅,the̍h","安眠,an-bîn","寄來,kià-lâi","密實,ba̍t-cha̍t","專員,choan-oân","尿鈷,jiō-kó͘/liō-kó͘","屁,phùi","屆時,kài-sî","屈橋,khut-kiô","屏遮那,Hè-sen-ná","屐,kia̍h","岩鹽,gâm-iâm","岳父,ga̍k-hū","年表,nî-pió","店租,tiàm-cho͘","庵廟,am-biō","廿,jia̍p/lia̍p","彪,piu","彼樣,hit-iūⁿ","徼,khiò","忍心,jím-sim/lím-sim","快活,khùiⁿ-oa̍h","忽然,hut-jiân/hut-liân","怦,phēⁿ","怯膽,khiap-táⁿ","恐畏,khióng-ùi","惜略,sioh-lio̍h","愕,go̍k","愣,gāng","慼心,chheh-sim/chhoeh-sim","憚,tān","懦,nō͘","懷念,hoâi-liām","戇,gōng","扒飯,pe-pn̄g","扭尻川,ngiú-kha-chhng","抓癢,jiàu-chiūⁿ/liàu-chiūⁿ","披埕,phi-tiâⁿ","抹粉,boah-hún","抾拾,khioh-si̍p","拆壇,thiah-toânn","拋出,phau-chhut","拋捎,pha-sa","拍插,phah-chhap","拖直,thoa-ti̍t","招倚,chio-óa","括流,koah-lâu","指,cháiⁿ","挓,thà","挕捒,hìⁿ-sak","挨餓,ai-gō","掀冊,hian-chheh","掃蕩,sàu-tōng","掇,toah","掙,chiāⁿ","掩目雞,om-ba̍k-ke/om-ba̍k-koe","插春,chhah-chhun","揬,tu̍h","搐,tiuh","搭嚇,tah-hiahⁿ","搭里霧,Tā-lí-buh","摳,kha̍uhⁿ","撇清,phiat-chheng","撓,ngiáu","撤職,thiat-chit","擉,tia̍k","擔當,tam-tng","擗,phia̍k","攀登,phan-teng","攔閘,nôa-cha̍h","敱,kháiⁿ","斟酒,thîn-chiú","方興未艾,hong-heng-bī-ngāi","昨,cho̍h","晚會,boán-hōe","晴,chêⁿ","晾,nê","曲線,khiok-soànn","朗讀,lóng-tho̍k","木業,bo̍k-gia̍p","末路,boa̍t-lō͘","杵,thú","枴,koái","染,jiám/liám","校閱,kàu-oa̍t","核可,he̍k-khó","桌屜,toh-thoah","榆,jiû/liû","標本,piau-pún","樸實,phoh-si̍t","橫扴,hoâiⁿ-ke̍h/hûiⁿ-ke̍h","檨,soāiⁿ","欶,suh","歇影,hioh-iáⁿ","歌譜,koa-phó͘","歡度,hoann-tō͘","歪斜,oai-chhoa̍h","每擺,múi-pái","沃雨,ak-hō͘","沉著,tîm-tio̍k","沒藥,bu̍t-io̍h","沓,ta̍uh","沓滴,ta̍p-tih","沖水,chhiâng-chúi","沫,phoe̍h/phe̍h","海蟹,hái-hē","涼腔,liâng-khiang","添設,thiam-siat","渺茫,biáu-bông","湠叢,thoànn-châng","滅無,bia̍t-bô","漂浮,phiau-phû","漉屎,lok-sái","漚肥,au-pûi","漳,chiang","潑扇,phoah-sìⁿ","潑賤,phoat-chiān","潤餅,jūn-piáⁿ/lūn-piáⁿ","澩,ha̍uhⁿ","激力,kek-la̍t","濺,choānn","煏,piak","煠,sa̍h","煤,môe","熁,hahⁿ","熊,hîm","熱烈,jia̍t-lia̍t/lia̍t-lia̍t","爁,nah","爹,tia","牚,thèⁿ","牛膝,giû-chhek","物,mi̍h/mn̍gh","物代,mih-tāi","牽強,khian-kiông","牽磕,khan-kha̍p","猛勇,béng-ióng","玉環,ge̍k-khoân","玉蘭,gio̍k-lân","玩具,goán-khū","甘苦,kam-khó͘","甪毛,lut-mn̂g","番薯,han-chî/han-chû","疊尖,thia̍p-chiam","疏散,so͘-sàn","癮甲,giàn-kah","百般,pah-poann","益蟲,ek-thiông","益閣,iah-koh","監牢,kaⁿ-lô","相閃,sio-siám","眉額,bâi-hia̍h","看,khoànn","眩痧,hîn-soa","眵,chhuh","眼福,gán-hok","睚,kâiⁿ","督察,tok-chhat","瞌,kheh/khoeh","砌,kih","研缽,géng-poah","破缺,phòa-khih","硩,teh","碗頭箸尾,oánn-thâu-tī-bóe/oánn-thâu-tū-bé","碧潭,phek-thâm","確保,khak-pó","磨坩,bôa-khaⁿ","礁石,ta-chio̍h","礎,chhó͘","礙著,gāi-tio̍h","票箱,phiò-siuⁿ","禿,thut","空空,khang-khang","突,tu̍t","笠,le̍h","筆算,pit-soàn","簇,chhok","簸,pòa","籤王,chhiam-ông","粒,lia̍p","糠瘡,khng-chhng","糶,thiò","紂,tiū","納采,la̍p-chhái","索梯,soh-thui","累積,lúi-chek","紺,khóng","結疤,kiat-pa","絕對,choa̍t-tùi","絨布,jiông-pò͘/liông-pò͘","經繭,keⁿ-kián/kiⁿ-kián","綠色,le̍k-sek","緝捕,chhip-pó͘","緟,thōng","編篡,pian-chhoàn","缺糧,khoat-niû","美味,bí-bī","翕熱,hip-joa̍h/hip-loa̍h","聘請,phèng-chhiáⁿ","聽錯,thiaⁿ-chhò","肉目,bah-ba̍k","脈搏,me̍h-phok","脫節,thoat-chiat","腔調,khiuⁿ-tiāu","腰骨,io-kut","腳錢,kioh-chîⁿ","船運,chûn-ūn","色牙,sek-gâ","茅草,mâu-chháu","草笠仔,chháu-le̍h-á/chháu-loe̍h-á","莢,ngeh","落落,lak-lo̍h","蓆,chhio̍h","蔥藕,chhang-ngāu","蕨貓,koeh-niau","薄待,po̍k-thāi","薄膜,po̍h-mo̍͘h","薑,kiuⁿ","藃,hiauh","藩屏,phoan-pîn","虹,khēng","蚻,choa̍h","蛤蜊,kap-lâ","蜀七,sio̍k-chhit","蜈蚣,giâ-kang","蜜月,bi̍t-goa̍t","蝕秤,si̍h-chhìn","蝛,bui","蝨,sat","蟯桮,giô-poe","蟯蟯動,ngia̍uh-ngia̍uh-tāng","蟳,chîm","蟶坪,than-phiâⁿ","蠓罩,báng-tàu","蠘,chhi̍h","蠻皮病,bân-phôe-pēⁿ/bân-phê-pīⁿ","血油,hoeh-iû/huih-iû","血緣,hiat-iân","裂縫,li̍h-phāng","裂隙,liah-khiah","褪,thǹg","褫奪,thí-toa̍t","襟章,khim-chiong","襪束,boe̍h-sok","規暝,kui-mê/kui-mî","覕喙,bih-chhùi","觸纏,tak-tîⁿ","訣說,koat-soat","詰舌,khiat-chi̍h","誇張,khoa-tiong","諜,tia̍p","謔削,gio̍h-siah","謗大,pòng-tōa","謙遜,khiam-sùn","謬誤,biū-gō͘","謼,ho͘h","豐沛,phong-phài","買囑,mái-chiok","賴,lōa","赤疹,chhiah-chín","超市,chhiau-chhī","趖,sô","跋涉,poa̍t-sia̍p","跡,jiah/liah","跤曲,kha-khiau","跩,choāiⁿ","跳躂,thiàu-that","躄倒,phih-tó","躡,neh/nih","輕聲細說,khin-siaⁿ-sè-soeh/khin-siaⁿ-sòe-seh","轄境,hat-kéng","辟走,phiah-cháu","迎神,ngiâ-sîn","迒,hāⁿ","迫切,pek-chhiat","迭,tia̍t","迸,piàng","送達,sàng-ta̍t","逝,chōa","遮勘,jia-khàm/lia-khàm","邀約,iau-iok","邑,ip","那通,ná-thang","郁,hiok","鄭,tēⁿ","酷人,khok-lâng","重青,tāng-chheⁿ/tāng-chhiⁿ","釣艚,tiò-chô","銀髮,gîn-hoat/gûn-hoat","銳減,jōe-kiám/lōe-kiám","錚,chhāⁿ","錦繡,gím-siù","鎮煞,tìn-soah","鏨,chām","鐵塔,thih-thah","鑠,siak","鑱,chhîm","鑿,chha̍k","閂,chhoànn","閱覽,ia̍t-lám","闊腹,khoah-pak","闖,chhoàng","關車,koaiⁿ-chhia/kuiⁿ-chhia","闡,chhián","阿沙不魯,a-sa-puh-luh","陷,hām","雜柴,cha̍p-chhâ","雞齊根,ke-chê-kin/koe-chôe-kun","靴管,hia-kóng","項,hāng","領班,niá-pan","額外,gia̍h-gōa","風吹日曝,hong-chhoe-ji̍t-pha̍k/hong-chhe-li̍t-pha̍k","香,hiuⁿ","香茅,hiang-hm̂","香華,hiong-hoa","騙,phiàn","驕傲,kiau-ngō͘","鬧房,nāu-pâng","鬱卒,ut-chut","魠,thoh","鱉,pih","鴆,thim","鶴,ho̍h","麥牙,be̍h-gê","麻衫,môa-saⁿ","默契,be̍k-khè/be̍k-khòe","黜,thuh","齴,giàng","龐,phiāng","𠢕,gâu","𠯗,chi̍p","𣁳,khat","𤆬,chhōa","𧮙,chhoh","𧿳,phu̍t","𨂿,oáiⁿ","𩚨,khiū","𩛩,kauh"]
    checker(additional, c, c_north)