from taibun.taibun import Converter
from utils import checker

hanji_data = ["這是臺南，簡稱「南」（白話字：Tâi-lâm；注音符號：ㄊㄞˊ ㄋㄢˊ，國語：Táinán）。1623年，荷蘭佇臺南近海中个安平起基地。1624年，荷蘭退出澎湖了後，對遮个開發，建設了熱蘭遮城（Fort Zeelandia）。"]

def test_format():
    test_data = [
        (['Tse sī Tâi-lâm, kán-tshing "lâm" (Pe̍h-uē-jī: Tâi-lâm; tsù-im hû-hō: ㄊㄞˊ ㄋㄢˊ, kok-gí: Táinán). 1623 nî, Hô-lân tī Tâi-lâm kīn-hái tiong ê an-pîng khí ki-tē. 1624 nî, Hô-lân thè tshut Phênn-ôo liáu-āu, tuì-tsia ê khai-huat, kiàn-siat liáu Jia̍t-lân-jia-siânn (Fort Zeelandia)./Tse sī Tâi-lâm, kán-tshing "lâm" (Pe̍h-uē-lī: Tâi-lâm; tsù-im hû-hō: ㄊㄞˊ ㄋㄢˊ, kok-gú: Táinán). 1623 nî, Hô-lân tī Tâi-lâm kūn-hái tiong ê an-pîng khí ki-tuē. 1624 nî, Hô-lân thè tshut Phênn-ôo liáu-āu, tuì-tsia ê khai-huat, kiàn-siat liáu Lia̍t-lân-lia-siânn (Fort Zeelandia).'], "Tailo"),
        (['Che sī Tâi-lâm, kán-chheng "lâm" (Pe̍h-ōe-jī: Tâi-lâm; chù-im hû-hō: ㄊㄞˊ ㄋㄢˊ, kok-gí: Táinán). 1623 nî, Hô-lân tī Tâi-lâm kīn-hái tiong ê an-pêng khí ki-tē. 1624 nî, Hô-lân thè chhut Phêⁿ-ô͘ liáu-āu, tùi-chia ê khai-hoat, kiàn-siat liáu Jia̍t-lân-jia-siâⁿ (Fort Zeelandia)./Che sī Tâi-lâm, kán-chheng "lâm" (Pe̍h-ōe-lī: Tâi-lâm; chù-im hû-hō: ㄊㄞˊ ㄋㄢˊ, kok-gú: Táinán). 1623 nî, Hô-lân tī Tâi-lâm kūn-hái tiong ê an-pêng khí ki-tōe. 1624 nî, Hô-lân thè chhut Phêⁿ-ô͘ liáu-āu, tùi-chia ê khai-hoat, kiàn-siat liáu Lia̍t-lân-lia-siâⁿ (Fort Zeelandia).'], "POJ"),
        (['ㄗㆤ ㄒㄧ˫ ㄉㄞˊ ㄌㆰˊ, ㄍㄢˋ ㄑㄧㄥ "ㄌㆰˊ" (ㄅㆤㆷ˙ ㄨㆤ˫ ㆢㄧ˫: Tâi-lâm; ㄗㄨ˪ ㄧㆬ ㄏㄨˊ ㄏㄜ˫: ㄊㄞˊ ㄋㄢˊ, ㄍㆦㆶ ㆣㄧˋ: Táinán). 1623 ㄋㄧˊ, ㄏㄜˊ ㄌㄢˊ ㄉㄧ˫ ㄉㄞˊ ㄌㆰˊ ㄍㄧㄣ˫ ㄏㄞˋ ㄉㄧㆲ ㆤˊ ㄢ ㄅㄧㄥˊ ㄎㄧˋ ㄍㄧ ㄉㆤ˫. 1624 ㄋㄧˊ, ㄏㄜˊ ㄌㄢˊ ㄊㆤ˪ ㄘㄨㆵ ㄆㆥˊ ㆦˊ ㄌㄧㄠˋ ㄠ˫, ㄉㄨㄧ˪ ㄐㄧㄚ ㆤˊ ㄎㄞ ㄏㄨㄚㆵ, ㄍㄧㄢ˪ ㄒㄧㄚㆵ ㄌㄧㄠˋ ㆢㄧㄚㆵ˙ ㄌㄢˊ ㆢㄧㄚ ㄒㄧㆩˊ (Fort Zeelandia)./ㄗㆤ ㄒㄧ˫ ㄉㄞˊ ㄌㆰˊ, ㄍㄢˋ ㄑㄧㄥ "ㄌㆰˊ" (ㄅㆤㆷ˙ ㄨㆤ˫ ㄌㄧ˫: Tâi-lâm; ㄗㄨ˪ ㄧㆬ ㄏㄨˊ ㄏㄜ˫: ㄊㄞˊ ㄋㄢˊ, ㄍㆦㆶ ㆣㄨˋ: Táinán). 1623 ㄋㄧˊ, ㄏㄜˊ ㄌㄢˊ ㄉㄧ˫ ㄉㄞˊ ㄌㆰˊ ㄍㄨㄣ˫ ㄏㄞˋ ㄉㄧㆲ ㆤˊ ㄢ ㄅㄧㄥˊ ㄎㄧˋ ㄍㄧ ㄉㄨㆤ˫. 1624 ㄋㄧˊ, ㄏㄜˊ ㄌㄢˊ ㄊㆤ˪ ㄘㄨㆵ ㄆㆥˊ ㆦˊ ㄌㄧㄠˋ ㄠ˫, ㄉㄨㄧ˪ ㄐㄧㄚ ㆤˊ ㄎㄞ ㄏㄨㄚㆵ, ㄍㄧㄢ˪ ㄒㄧㄚㆵ ㄌㄧㄠˋ ㄌㄧㄚㆵ˙ ㄌㄢˊ ㄌㄧㄚ ㄒㄧㆩˊ (Fort Zeelandia).'], "Zhuyin"),
        (['Ce1 si7 Tai5 lam5, kan2 ching1 "lam5" (Peh8 ue7 ji7: Tâi-lâm; cu3 im1 hu5 ho7: ㄊㄞˊ ㄋㄢˊ, kok4 gi2: Táinán). 1623 ni5, Ho5 lan5 ti7 Tai5 lam5 kin7 hai2 tiong1 e5 an1 ping5 khi2 ki1 te7. 1624 ni5, Ho5 lan5 the3 chut4 Phenn5 oo5 liau2 au7, tui3 cia1 e5 khai1 huat4, kian3 siat4 liau2 Jiat8 lan5 jia1 siann5 (Fort Zeelandia)./Ce1 si7 Tai5 lam5, kan2 ching1 "lam5" (Peh8 ue7 li7: Tâi-lâm; cu3 im1 hu5 ho7: ㄊㄞˊ ㄋㄢˊ, kok4 gu2: Táinán). 1623 ni5, Ho5 lan5 ti7 Tai5 lam5 kun7 hai2 tiong1 e5 an1 ping5 khi2 ki1 tue7. 1624 ni5, Ho5 lan5 the3 chut4 Phenn5 oo5 liau2 au7, tui3 cia1 e5 khai1 huat4, kian3 siat4 liau2 Liat8 lan5 lia1 siann5 (Fort Zeelandia).'], "TLPA"),
        (['Zē sî Dáilám, gǎncīng "lám" (Béhwêzzî: Tâi-lâm; zùyīm húhô: ㄊㄞˊ ㄋㄢˊ, gōkggǐ: Táinán). 1623 lní, Hólán dî Dáilám gînhǎi diōng é ānbíng kǐ gīdê. 1624 lní, Hólán tè cūt Pnéoó liǎoâo, duìziā é kāihuāt, giànsiāt liǎo Zziátlánzziāsiná (Fort Zeelandia)./Zē sî Dáilám, gǎncīng "lám" (Béhwêlî: Tâi-lâm; zùyīm húhô: ㄊㄞˊ ㄋㄢˊ, gōkggǔ: Táinán). 1623 lní, Hólán dî Dáilám gûnhǎi diōng é ānbíng kǐ gīduê. 1624 lní, Hólán tè cūt Pnéoó liǎoâo, duìziā é kāihuāt, giànsiāt liǎo Liátlánliāsiná (Fort Zeelandia).'], "Pingyim"),
        (['Ze sî Dāi-lăm, gan-cing "lăm" (Bê-uê-rī: Tâi-lâm; zù-īm hū-hōr: ㄊㄞˊ ㄋㄢˊ, gok-ghì: Táinán). 1623 nĭ, Hōr-lān dî Dāi-lām gîn-hai diōng ē ān-bīng ki gī-dē. 1624 nĭ, Hōr-lān tè cut Pēnn-ōr liau-āu, duì-ziā ē kāi-huāt, giàn-siat liau Riāt-lān-riā-siănn (Fort Zeelandia)./Ze sî Dâi-lăm, gan-cing "lăm" (Bê-uê-lī: Tâi-lâm; zù-īm hû-hōr: ㄊㄞˊ ㄋㄢˊ, gok-ghù: Táinán). 1623 nĭ, Hôr-lân dî Dâi-lâm gûn-hai diōng ê ān-bîng ki gī-duē. 1624 nĭ, Hôr-lân tè cut Pênn-ôr liau-āu, duì-ziā ê kāi-huāt, giàn-siat liau Liāt-lân-liā-siănn (Fort Zeelandia).'], "Tongiong"),
        (['Tse⁴⁴ ɕi²² Tai²⁵ lam²⁵, kan⁵³ tɕʰiɪŋ⁴⁴ "lam²⁵" (Peʔ⁵ ue²² dʑi²²: Tâi-lâm; tsu¹¹ im⁴⁴ hu²⁵ hə²²: ㄊㄞˊ ㄋㄢˊ, kɔk̚²¹ gi⁵³: Táinán). 1623 nĩ²⁵, Hə²⁵ lan²⁵ ti²² Tai²⁵ lam²⁵ kin²² hai⁵³ tiɔŋ⁴⁴ e²⁵ an⁴⁴ piɪŋ²⁵ kʰi⁵³ ki⁴⁴ te²². 1624 nĩ²⁵, Hə²⁵ lan²⁵ tʰe¹¹ tsʰut̚²¹ Pʰẽ²⁵ ɔ²⁵ liau⁵³ au²², tui¹¹ tɕia⁴⁴ e²⁵ kʰai⁴⁴ huat̚²¹, kiɛn¹¹ ɕiɛt̚²¹ liau⁵³ Dʑiɛt̚⁵ lan²⁵ dʑia⁴⁴ ɕiã²⁵ (Fort Zeelandia)./Tse⁵⁵ ɕi³³ Tai²⁴ lam²⁴, kan⁵¹ tɕʰiɪŋ⁵⁵ "lam²⁴" (Peʔ⁴ ue³³ li³³: Tâi-lâm; tsu²¹ im⁵⁵ hu²⁴ ho³³: ㄊㄞˊ ㄋㄢˊ, kɔk̚³² gu⁵¹: Táinán). 1623 nĩ²⁴, Ho²⁴ lan²⁴ ti³³ Tai²⁴ lam²⁴ kun³³ hai⁵¹ tiɔŋ⁵⁵ e²⁴ an⁵⁵ piɪŋ²⁴ kʰi⁵¹ ki⁵⁵ tue³³. 1624 nĩ²⁴, Ho²⁴ lan²⁴ tʰe²¹ tsʰut̚³² Pʰẽ²⁴ ɔ²⁴ liau⁵¹ au³³, tui²¹ tɕia⁵⁵ e²⁴ kʰai⁵⁵ huat̚³², kiɛn²¹ ɕiɛt̚³² liau⁵¹ Liɛt̚⁴ lan²⁴ lia⁵⁵ ɕiã²⁴ (Fort Zeelandia).'], "IPA")
    ]
    for transl, system in test_data:
        data = list(zip(hanji_data, transl))
        checker(data, Converter(system=system, punctuation='format'), Converter(system=system, dialect="north", punctuation='format'))

def test_none():
    test_data = [
        (['tse sī Tâi-lâm，kán-tshing「lâm」（Pe̍h-uē-jī：Tâi-lâm；tsù-im hû-hō：ㄊㄞˊ ㄋㄢˊ，kok-gí：Táinán）。1623 nî，Hô-lân tī Tâi-lâm kīn-hái tiong ê an-pîng khí ki-tē。1624 nî，Hô-lân thè tshut Phênn-ôo liáu-āu，tuì-tsia ê khai-huat，kiàn-siat liáu Jia̍t-lân-jia-siânn（Fort Zeelandia）。/tse sī Tâi-lâm，kán-tshing「lâm」（Pe̍h-uē-lī：Tâi-lâm；tsù-im hû-hō：ㄊㄞˊ ㄋㄢˊ，kok-gú：Táinán）。1623 nî，Hô-lân tī Tâi-lâm kūn-hái tiong ê an-pîng khí ki-tuē。1624 nî，Hô-lân thè tshut Phênn-ôo liáu-āu，tuì-tsia ê khai-huat，kiàn-siat liáu Lia̍t-lân-lia-siânn（Fort Zeelandia）。'], "Tailo"),
        (['che sī Tâi-lâm，kán-chheng「lâm」（Pe̍h-ōe-jī：Tâi-lâm；chù-im hû-hō：ㄊㄞˊ ㄋㄢˊ，kok-gí：Táinán）。1623 nî，Hô-lân tī Tâi-lâm kīn-hái tiong ê an-pêng khí ki-tē。1624 nî，Hô-lân thè chhut Phêⁿ-ô͘ liáu-āu，tùi-chia ê khai-hoat，kiàn-siat liáu Jia̍t-lân-jia-siâⁿ（Fort Zeelandia）。/che sī Tâi-lâm，kán-chheng「lâm」（Pe̍h-ōe-lī：Tâi-lâm；chù-im hû-hō：ㄊㄞˊ ㄋㄢˊ，kok-gú：Táinán）。1623 nî，Hô-lân tī Tâi-lâm kūn-hái tiong ê an-pêng khí ki-tōe。1624 nî，Hô-lân thè chhut Phêⁿ-ô͘ liáu-āu，tùi-chia ê khai-hoat，kiàn-siat liáu Lia̍t-lân-lia-siâⁿ（Fort Zeelandia）。'], "POJ"),
        (['ㄗㆤ ㄒㄧ˫ ㄉㄞˊ ㄌㆰˊ，ㄍㄢˋ ㄑㄧㄥ「ㄌㆰˊ」（ㄅㆤㆷ˙ ㄨㆤ˫ ㆢㄧ˫：Tâi-lâm；ㄗㄨ˪ ㄧㆬ ㄏㄨˊ ㄏㄜ˫：ㄊㄞˊ ㄋㄢˊ，ㄍㆦㆶ ㆣㄧˋ：Táinán）。1623 ㄋㄧˊ，ㄏㄜˊ ㄌㄢˊ ㄉㄧ˫ ㄉㄞˊ ㄌㆰˊ ㄍㄧㄣ˫ ㄏㄞˋ ㄉㄧㆲ ㆤˊ ㄢ ㄅㄧㄥˊ ㄎㄧˋ ㄍㄧ ㄉㆤ˫。1624 ㄋㄧˊ，ㄏㄜˊ ㄌㄢˊ ㄊㆤ˪ ㄘㄨㆵ ㄆㆥˊ ㆦˊ ㄌㄧㄠˋ ㄠ˫，ㄉㄨㄧ˪ ㄐㄧㄚ ㆤˊ ㄎㄞ ㄏㄨㄚㆵ，ㄍㄧㄢ˪ ㄒㄧㄚㆵ ㄌㄧㄠˋ ㆢㄧㄚㆵ˙ ㄌㄢˊ ㆢㄧㄚ ㄒㄧㆩˊ（Fort Zeelandia）。/ㄗㆤ ㄒㄧ˫ ㄉㄞˊ ㄌㆰˊ，ㄍㄢˋ ㄑㄧㄥ「ㄌㆰˊ」（ㄅㆤㆷ˙ ㄨㆤ˫ ㄌㄧ˫：Tâi-lâm；ㄗㄨ˪ ㄧㆬ ㄏㄨˊ ㄏㄜ˫：ㄊㄞˊ ㄋㄢˊ，ㄍㆦㆶ ㆣㄨˋ：Táinán）。1623 ㄋㄧˊ，ㄏㄜˊ ㄌㄢˊ ㄉㄧ˫ ㄉㄞˊ ㄌㆰˊ ㄍㄨㄣ˫ ㄏㄞˋ ㄉㄧㆲ ㆤˊ ㄢ ㄅㄧㄥˊ ㄎㄧˋ ㄍㄧ ㄉㄨㆤ˫。1624 ㄋㄧˊ，ㄏㄜˊ ㄌㄢˊ ㄊㆤ˪ ㄘㄨㆵ ㄆㆥˊ ㆦˊ ㄌㄧㄠˋ ㄠ˫，ㄉㄨㄧ˪ ㄐㄧㄚ ㆤˊ ㄎㄞ ㄏㄨㄚㆵ，ㄍㄧㄢ˪ ㄒㄧㄚㆵ ㄌㄧㄠˋ ㄌㄧㄚㆵ˙ ㄌㄢˊ ㄌㄧㄚ ㄒㄧㆩˊ（Fort Zeelandia）。'], "Zhuyin"),
        (['ce1 si7 Tai5 lam5，kan2 ching1「lam5」（Peh8 ue7 ji7：Tâi-lâm；cu3 im1 hu5 ho7：ㄊㄞˊ ㄋㄢˊ，kok4 gi2：Táinán）。1623 ni5，Ho5 lan5 ti7 Tai5 lam5 kin7 hai2 tiong1 e5 an1 ping5 khi2 ki1 te7。1624 ni5，Ho5 lan5 the3 chut4 Phenn5 oo5 liau2 au7，tui3 cia1 e5 khai1 huat4，kian3 siat4 liau2 Jiat8 lan5 jia1 siann5（Fort Zeelandia）。/ce1 si7 Tai5 lam5，kan2 ching1「lam5」（Peh8 ue7 li7：Tâi-lâm；cu3 im1 hu5 ho7：ㄊㄞˊ ㄋㄢˊ，kok4 gu2：Táinán）。1623 ni5，Ho5 lan5 ti7 Tai5 lam5 kun7 hai2 tiong1 e5 an1 ping5 khi2 ki1 tue7。1624 ni5，Ho5 lan5 the3 chut4 Phenn5 oo5 liau2 au7，tui3 cia1 e5 khai1 huat4，kian3 siat4 liau2 Liat8 lan5 lia1 siann5（Fort Zeelandia）。'], "TLPA"),
        (['zē sî Dáilám，gǎncīng「lám」（Béhwêzzî：Tâi-lâm；zùyīm húhô：ㄊㄞˊ ㄋㄢˊ，gōkggǐ：Táinán）。1623 lní，Hólán dî Dáilám gînhǎi diōng é ānbíng kǐ gīdê。1624 lní，Hólán tè cūt Pnéoó liǎoâo，duìziā é kāihuāt，giànsiāt liǎo Zziátlánzziāsiná（Fort Zeelandia）。/zē sî Dáilám，gǎncīng「lám」（Béhwêlî：Tâi-lâm；zùyīm húhô：ㄊㄞˊ ㄋㄢˊ，gōkggǔ：Táinán）。1623 lní，Hólán dî Dáilám gûnhǎi diōng é ānbíng kǐ gīduê。1624 lní，Hólán tè cūt Pnéoó liǎoâo，duìziā é kāihuāt，giànsiāt liǎo Liátlánliāsiná（Fort Zeelandia）。'], "Pingyim"),
        (['ze sî Dāi-lăm，gan-cing「lăm」（Bê-uê-rī：Tâi-lâm；zù-īm hū-hōr：ㄊㄞˊ ㄋㄢˊ，gok-ghì：Táinán）。1623 nĭ，Hōr-lān dî Dāi-lām gîn-hai diōng ē ān-bīng ki gī-dē。1624 nĭ，Hōr-lān tè cut Pēnn-ōr liau-āu，duì-ziā ē kāi-huāt，giàn-siat liau Riāt-lān-riā-siănn（Fort Zeelandia）。/ze sî Dâi-lăm，gan-cing「lăm」（Bê-uê-lī：Tâi-lâm；zù-īm hû-hōr：ㄊㄞˊ ㄋㄢˊ，gok-ghù：Táinán）。1623 nĭ，Hôr-lân dî Dâi-lâm gûn-hai diōng ê ān-bîng ki gī-duē。1624 nĭ，Hôr-lân tè cut Pênn-ôr liau-āu，duì-ziā ê kāi-huāt，giàn-siat liau Liāt-lân-liā-siănn（Fort Zeelandia）。'], "Tongiong"),
        (['tse⁴⁴ ɕi²² Tai²⁵ lam²⁵，kan⁵³ tɕʰiɪŋ⁴⁴「lam²⁵」（Peʔ⁵ ue²² dʑi²²：Tâi-lâm；tsu¹¹ im⁴⁴ hu²⁵ hə²²：ㄊㄞˊ ㄋㄢˊ，kɔk̚²¹ gi⁵³：Táinán）。1623 nĩ²⁵，Hə²⁵ lan²⁵ ti²² Tai²⁵ lam²⁵ kin²² hai⁵³ tiɔŋ⁴⁴ e²⁵ an⁴⁴ piɪŋ²⁵ kʰi⁵³ ki⁴⁴ te²²。1624 nĩ²⁵，Hə²⁵ lan²⁵ tʰe¹¹ tsʰut̚²¹ Pʰẽ²⁵ ɔ²⁵ liau⁵³ au²²，tui¹¹ tɕia⁴⁴ e²⁵ kʰai⁴⁴ huat̚²¹，kiɛn¹¹ ɕiɛt̚²¹ liau⁵³ Dʑiɛt̚⁵ lan²⁵ dʑia⁴⁴ ɕiã²⁵（Fort Zeelandia）。/tse⁵⁵ ɕi³³ Tai²⁴ lam²⁴，kan⁵¹ tɕʰiɪŋ⁵⁵「lam²⁴」（Peʔ⁴ ue³³ li³³：Tâi-lâm；tsu²¹ im⁵⁵ hu²⁴ ho³³：ㄊㄞˊ ㄋㄢˊ，kɔk̚³² gu⁵¹：Táinán）。1623 nĩ²⁴，Ho²⁴ lan²⁴ ti³³ Tai²⁴ lam²⁴ kun³³ hai⁵¹ tiɔŋ⁵⁵ e²⁴ an⁵⁵ piɪŋ²⁴ kʰi⁵¹ ki⁵⁵ tue³³。1624 nĩ²⁴，Ho²⁴ lan²⁴ tʰe²¹ tsʰut̚³² Pʰẽ²⁴ ɔ²⁴ liau⁵¹ au³³，tui²¹ tɕia⁵⁵ e²⁴ kʰai⁵⁵ huat̚³²，kiɛn²¹ ɕiɛt̚³² liau⁵¹ Liɛt̚⁴ lan²⁴ lia⁵⁵ ɕiã²⁴（Fort Zeelandia）。'], "IPA")
    ]
    for transl, system in test_data:
        data = list(zip(hanji_data, transl))
        checker(data, Converter(system=system, punctuation='none'), Converter(system=system, dialect="north", punctuation='none'))