Module:wuu-pron/Jinhua

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Test cases

[edit]

  • |w-j=7iq peq7#1ciaon

  • |w-j=7tseq ciaon1T

  • |w-j=2moea tsi7R

  • |w-j=8gniq 6li4

  • PO:


  • 唱歌 |w-j=5chiaon kuo1P /33 334/

  • 發財发财 |w-j=5Cfoea dzae2P /55 313/

  • Neutralised tail:

    • 包子 |w-j=1pau tsy3T /33 55/


    • 浙江 |w-j=7tseq ciaon1T /4 0/

    Nums#Classifier:



    ( behaves differently from all the other tone 7 numbers when followed by tones 2 4 6 8. if the classifier is tone 2 it stays tone 2 /313/, if it is tone 4 or 6 change to 6 /14/, if the classifier is tone 8 it stays tone 8 /212/.)

    (The numerical tone input for it is 7A#[2468] or 7#[1357].)



    Erhua:

    • 麻雀 |w-j=2moea tsi7R,2moea tsinn7R /33 55/

    • Wu
      • (Jinhua)
        • Wugniu: 2moea-tsi7R; 2moea-tsinn7R
        • Sinological IPA (Jinhua): /mɤa³³ t͡si⁵⁵/, /mɤa³³ t͡sĩ⁵⁵/


    --jinhuanese experiemental module (ignore the "Hangzhou" bit)
    local w_pron = require("Module:wuu-pron")
    
    local export = {}
    
    local ipa_initial = {
    	["p"] = "p", ["ph"] = "pʰ", ["b"] = "b", ["m"] = "m", ["f"] = "f", ["v"] = "v",
    	["t"] = "t", ["th"] = "tʰ", ["d"] = "d", ["n"] = "n", ["l"] = "l",
    	["ts"] = "t͡s", ["tsh"] = "t͡sʰ", ["s"] = "s", ["z"] = "z", ["c"] = "t͡ɕ", ["ch"] = "t͡ɕʰ",
    	["dz"] = "d͡z", ["j"] = "d͡ʑ", ["gn"] = "n̠ʲ", ["sh"] = "ɕ", ["zh"] = "ʑ",
    	["k"] = "k", ["kh"] = "kʰ", ["g"] = "ɡ", ["ng"] = "ŋ", ["h"] = "h", ["gh"] = "ɦ",
    	[""] = "",
    }
    
    --[""] = "", 
    local ipa_final = {
    	["oea"] = "ɤa", ["a"] = "ɑ", ["o"] = "o", ["oe"] = "ɤ", ["ou"] = "ɯ", ["ae"] = "ɛ", ["ei"] = "ei", ["au"] = "ɑu", ["eu"] = "eu",
    	["i"] = "i", ["iaa"] = "ia", ["ia"] = "iɑ", ["ie"] = "ie", ["iei"] = "iɛ", ["iae"] = "iɛ", ["iau"] = "iɑu", ["ieu"] = "iu",
    	["u"] = "u", ["ua"] = "uɑ", ["uo"] = "uɤ", ["uae"] = "uɛ", ["ui"] = "ui",
    	["iu"] = "y", ["iua"] = "yɑ", ["ioe"] = "yɤ", ["iuae"] = "yɛ",
    	["en"] = "əŋ", ["oen"] = "ɤã", ["an"] = "ã", ["aon"] = "ɑŋ", ["on"] = "oŋ",
    	["in"] = "iŋ", ["ian"] = "iã", ["iaon"] = "iɑŋ", ["ion"] = "ioŋ",
    	["uen"] = "uəŋ", ["uan"] = "uã", ["uaon"] = "uɑŋ",
    	["iun"] = "yəŋ", ["iuan"] = "yã", ["iuaon"] = "yɑŋ",
    	["eq"] = "əʔ", ["oq"] = "oʔ", 
    	["iq"] = "iəʔ", ["ioq"] = "ioʔ", 
    	["ueq"] = "uəʔ",
    	["iuq"] = "yəʔ",
    	["er"] = "əl", ["y"] = "z̩",
        --Erhua rimes (a priori for now, not seen in the dictionary body at wugniu.com)
        ["ynn"] = "z̩̃", ["inn"] = "ĩ", ["unn"] = "ũ", ["iunn"] = "ỹ",
        ["ieunn"] = "iũ", ["oenn"] = "ɤ̃",
        ["enn"] = "ẽ", ["ienn"] = "iẽ", ["uenn"] = "uẽ", ["iuenn"] = "yẽ",
        ["aunn"] = "ɔ̃", ["iaunn"] = "iɔ̃", ["onn"] = "õ", ["ionn"] = "iõ"
    }
    
    local function get_initial(initial)
    	return ipa_initial[initial] or error('Invalid initial: "' .. initial .. '"')
    end
    
    local function get_final(final)
    	return ipa_final[final] or error('Invalid final: "' .. final .. '"')
    end
    
    local ipa_syllabic = {
    	["m"] = "m̩", ["ng"] = "ŋ̍",
    }
    
    local tone_contours = {
    	["10"] = "",
    	["11"] = "334", ["12"] = "313", ["13"] = "535", ["14"] = "535", ["15"] = "55", ["16"] = "14", ["17"] = "44", ["18"] = "212", 
    	["17A"] = "44", 
    	--17A for 一 and only 一 in number sandhi
    	
    	--sandhi: 當代 pp. 657, etc.
    	--Word (Phrase) sandhi: 吳語婺州方言研究 pp. 102 onwards.
    	--disyllabic
    	["211"] = "33 55", ["212"] = "33 55", ["213"] = "33 535", ["214"] = "33 535", ["215"] = "33 55", ["216"] = "33 55", ["217"] = "33 44", ["218"] = "33 212",
    	["221"] = "31 55", ["222"] = "31 14", ["223"] = "33 535", ["224"] = "33 535", ["225"] = "31 55", ["225C"] = "33 55", ["226"] = "31 14", ["227"] = "33 44", ["228"] = "33 212",
    	["231"] = "55 334", ["232"] = "55 313", ["233"] = "53 535", ["234"] = "53 535", ["235"] = "53 55", ["236"] = "55 14", ["237"] = "53 44", ["238"] = "55 212",
    	["241"] = "55 334", ["242"] = "55 313", ["243"] = "53 535", ["244"] = "33 535", ["245"] = "53 55", ["246"] = "55 14", ["247"] = "534 44", ["248"] = "55 212", ["24A1"] = "53 55",
    	["251"] = "33 55", ["252"] = "33 14", ["253"] = "33 535", ["254"] = "33 535", ["255"] = "53 55", ["256"] = "55 14", ["257"] = "33 44", ["258"] = "55 212",
    	["25A2"] = "33 55", ["25A6"] = "33 55",	["25C1"] = "55 0", ["25C3"] = "53 535", ["25C4"] = "53 535", 
    	["261"] = "53 55", ["262"] = "53 14", ["263"] = "53 535", ["264"] = "33 535", ["265"] = "53 55", ["266"] = "55 14", ["267"] = "53 44", ["268"] = "55 212",
    	["26A2"] = "33 55", ["26A3"] = "33 55",	["26A5"] = "33 55", ["26A6"] = "33 55",	["26C2"] = "55 0",
    	["271"] = "44 55", ["272"] = "44 55", ["273"] = "44 535", ["274"] = "44 535", ["275"] = "44 55", ["276"] = "44 14", ["277"] = "44 44", ["278"] = "44 212",
    	["281"] = "21 55", ["282"] = "21 14", ["283"] = "21 535", ["284"] = "21 535", ["285"] = "21 55", ["286"] = "21 14", ["287"] = "21 44", ["288"] = "21 212",
    
    	--trisyllabic word sandhi. not tabulated but vaguely described in above source
    	["3111"] = "33 33 55", ["3112"] = "33 33 55", ["3113"] = "33 33 535", ["3114"] = "33 33 535", ["3115"] = "33 33 55", ["3116"] = "33 33 55", ["3117"] = "33 33 44", ["3118"] = "33 33 212",
    	["3121"] = "33 31 55", ["3122"] = "33 31 14", ["3123"] = "33 33 535", ["3124"] = "33 33 535", ["3125"] = "33 31 55", ["3125C"] = "33 33 55", ["3126"] = "33 31 14", ["3127"] = "33 33 44", ["3128"] = "33 33 212",
    	["3131"] = "33 55 334", ["3132"] = "33 55 313", ["3133"] = "33 53 535", ["3134"] = "33 53 535", ["3135"] = "33 53 55", ["3136"] = "33 55 14", ["3137"] = "33 53 44", ["3138"] = "33 55 212",
    	["3141"] = "33 55 334", ["3142"] = "33 55 313", ["3143"] = "33 53 535", ["3144"] = "33 33 535", ["3145"] = "33 53 55", ["3146"] = "33 55 14", ["3147"] = "33 53 44", ["3148"] = "33 55 212", ["314A1"] = "33 53 55",
    	["3151"] = "33 33 55", ["3152"] = "33 33 14", ["3153"] = "33 33 535", ["3154"] = "33 33 535", ["3155"] = "33 53 55", ["3156"] = "33 55 14", ["3157"] = "33 33 44", ["3158"] = "33 55 212",
    	["315A2"] = "33 33 55", ["315A6"] = "33 33 55", ["315C1"] = "33 55 0", ["315C3"] = "33 53 535", ["315C4"] = "33 53 535", 
    	["3161"] = "33 53 55", ["3162"] = "33 53 14", ["3163"] = "33 53 535", ["3164"] = "33 33 535", ["3165"] = "33 53 55", ["3166"] = "33 55 14", ["3167"] = "33 53 44", ["3168"] = "33 55 212",
    	["316A2"] = "33 33 55", ["316A3"] = "33 33 55", ["316A5"] = "33 33 55", ["316A6"] = "33 33 55",	["316C2"] = "33 55 0",
    	["3171"] = "33 44 55", ["3172"] = "33 44 55", ["3173"] = "33 44 535", ["3174"] = "33 44 535", ["3175"] = "33 44 55", ["3176"] = "33 44 14", ["3177"] = "33 44 44", ["3178"] = "33 44 212",
    	["3181"] = "33 21 55", ["3182"] = "33 21 14", ["3183"] = "33 21 535", ["3184"] = "33 21 535", ["3185"] = "33 21 55", ["3186"] = "33 21 14", ["3187"] = "33 21 44", ["3188"] = "33 21 212",
    
    	["3211"] = "33 33 55", ["3212"] = "33 33 55", ["3213"] = "33 33 535", ["3214"] = "33 33 535", ["3215"] = "33 33 55", ["3216"] = "33 33 55", ["3217"] = "33 33 44", ["3218"] = "33 33 212",
    	["3221"] = "33 31 55", ["3222"] = "33 31 14", ["3223"] = "33 33 535", ["3224"] = "33 33 535", ["3225"] = "33 31 55", ["3225C"] = "33 33 55", ["3226"] = "33 31 14", ["3227"] = "33 33 44", ["3228"] = "33 33 212",
    	["3231"] = "33 55 334", ["3232"] = "33 55 313", ["3233"] = "33 53 535", ["3234"] = "33 53 535", ["3235"] = "33 53 55", ["3236"] = "33 55 14", ["3237"] = "33 53 44", ["3238"] = "33 55 212",
    	["3241"] = "33 55 334", ["3242"] = "33 55 313", ["3243"] = "33 53 535", ["3244"] = "33 33 535", ["3245"] = "33 53 55", ["3246"] = "33 55 14", ["3247"] = "33 53 44", ["3248"] = "33 55 212", ["324A1"] = "33 53 55",
    	["3251"] = "33 33 55", ["3252"] = "33 33 14", ["3253"] = "33 33 535", ["3254"] = "33 33 535", ["3255"] = "33 53 55", ["3256"] = "33 55 14", ["3257"] = "33 33 44", ["3258"] = "33 55 212",
    	["325A2"] = "33 33 55", ["325A6"] = "33 33 55", ["325C1"] = "33 55 0", ["325C3"] = "33 53 535", ["325C4"] = "33 53 535", 
    	["3261"] = "33 53 55", ["3262"] = "33 53 14", ["3263"] = "33 53 535", ["3264"] = "33 33 535", ["3265"] = "33 53 55", ["3266"] = "33 55 14", ["3267"] = "33 53 44", ["3268"] = "33 55 212",
    	["326A2"] = "33 33 55", ["326A3"] = "33 33 55", ["326A5"] = "33 33 55", ["326A6"] = "33 33 55",	["326C2"] = "33 55 0",
    	["3271"] = "33 44 55", ["3272"] = "33 44 55", ["3273"] = "33 44 535", ["3274"] = "33 44 535", ["3275"] = "33 44 55", ["3276"] = "33 44 14", ["3277"] = "33 44 44", ["3278"] = "33 44 212",
    	["3281"] = "33 21 55", ["3282"] = "33 21 14", ["3283"] = "33 21 535", ["3284"] = "33 21 535", ["3285"] = "33 21 55", ["3286"] = "33 21 14", ["3287"] = "33 21 44", ["3288"] = "33 21 212",
    
    	["3311"] = "55 33 55", ["3312"] = "55 33 55", ["3313"] = "55 33 535", ["3314"] = "55 33 535", ["3315"] = "55 33 55", ["3316"] = "55 33 55", ["3317"] = "55 33 44", ["3218"] = "55 33 212",
    	["3321"] = "55 31 55", ["3322"] = "55 31 14", ["3323"] = "55 33 535", ["3324"] = "55 33 535", ["3325"] = "55 31 55", ["3325C"] = "55 33 55", ["3326"] = "55 31 14", ["3327"] = "55 33 44", ["3328"] = "55 33 212",
    	["3331"] = "55 55 334", ["3332"] = "55 55 313", ["3333"] = "55 53 535", ["3334"] = "55 53 535", ["3335"] = "55 53 55", ["3336"] = "55 55 14", ["3337"] = "55 53 44", ["3338"] = "55 55 212",
    	["3341"] = "55 55 334", ["3342"] = "55 55 313", ["3343"] = "55 53 535", ["3344"] = "55 33 535", ["3345"] = "55 53 55", ["3346"] = "55 55 14", ["3347"] = "55 53 44", ["3348"] = "55 55 212", ["334A1"] = "55 53 55",
    	["3351"] = "55 33 55", ["3352"] = "55 33 14", ["3353"] = "55 33 535", ["3354"] = "55 33 535", ["3355"] = "55 53 55", ["3356"] = "55 55 14", ["3357"] = "55 33 44", ["3358"] = "55 55 212",
    	["335A2"] = "55 33 55", ["335A6"] = "55 33 55", ["335C1"] = "55 55 0", ["335C3"] = "55 53 535", ["335C4"] = "55 53 535", 
    	["3361"] = "55 53 55", ["3362"] = "55 53 14", ["3363"] = "55 53 535", ["3364"] = "55 33 535", ["3365"] = "55 53 55", ["3366"] = "55 55 14", ["3367"] = "55 53 44", ["3368"] = "55 55 212",
    	["336A2"] = "55 33 55", ["336A3"] = "55 33 55", ["336A5"] = "55 33 55", ["336A6"] = "55 33 55",	["336C2"] = "55 55 0",
    	["3371"] = "55 44 55", ["3372"] = "55 44 55", ["3373"] = "55 44 535", ["3374"] = "55 44 535", ["3375"] = "55 44 55", ["3376"] = "55 44 14", ["3377"] = "55 44 44", ["3378"] = "55 44 212",
    	["3381"] = "55 21 55", ["3382"] = "55 21 14", ["3383"] = "55 21 535", ["3384"] = "55 21 535", ["3385"] = "55 21 55", ["3386"] = "55 21 14", ["3387"] = "55 21 44", ["3388"] = "55 21 212",
    
    	["3411"] = "55 33 55", ["3412"] = "55 33 55", ["3413"] = "55 33 535", ["3414"] = "55 33 535", ["3415"] = "55 33 55", ["3416"] = "55 33 55", ["3417"] = "55 33 44", ["3218"] = "55 33 212",
    	["3421"] = "55 31 55", ["3422"] = "55 31 14", ["3423"] = "55 33 535", ["3424"] = "55 33 535", ["3425"] = "55 31 55", ["3425C"] = "55 33 55", ["3426"] = "55 31 14", ["3427"] = "55 33 44", ["3428"] = "55 33 212",
    	["3431"] = "55 55 334", ["3432"] = "55 55 313", ["3433"] = "55 53 535", ["3434"] = "55 53 535", ["3435"] = "55 53 55", ["3436"] = "55 55 14", ["3437"] = "55 53 44", ["3438"] = "55 55 212",
    	["3441"] = "55 55 334", ["3442"] = "55 55 313", ["3443"] = "55 53 535", ["3444"] = "55 33 535", ["3445"] = "55 53 55", ["3446"] = "55 55 14", ["3447"] = "55 53 44", ["3448"] = "55 55 212", ["334A1"] = "55 53 55",
    	["3451"] = "55 33 55", ["3452"] = "55 33 14", ["3453"] = "55 33 535", ["3454"] = "55 33 535", ["3455"] = "55 53 55", ["3456"] = "55 55 14", ["3457"] = "55 33 44", ["3458"] = "55 55 212",
    	["345A2"] = "55 33 55", ["345A6"] = "55 33 55", ["345C1"] = "55 55 0", ["345C3"] = "55 53 535", ["345C4"] = "55 53 535", 
    	["3461"] = "55 53 55", ["3462"] = "55 53 14", ["3463"] = "55 53 535", ["3464"] = "55 33 535", ["3465"] = "55 53 55", ["3466"] = "55 55 14", ["3467"] = "55 53 44", ["3468"] = "55 55 212",
    	["346A2"] = "55 33 55", ["346A3"] = "55 33 55", ["346A5"] = "55 33 55", ["346A6"] = "55 33 55",	["346C2"] = "55 55 0",
    	["3471"] = "55 44 55", ["3472"] = "55 44 55", ["3473"] = "55 44 535", ["3474"] = "55 44 535", ["3475"] = "55 44 55", ["3476"] = "55 44 14", ["3477"] = "55 44 44", ["3478"] = "55 44 212",
    	["3481"] = "55 21 55", ["3482"] = "55 21 14", ["3483"] = "55 21 535", ["3484"] = "55 21 535", ["3485"] = "55 21 55", ["3486"] = "55 21 14", ["3487"] = "55 21 44", ["3488"] = "55 21 212",
    
    	["3511"] = "33 33 55", ["3512"] = "33 33 55", ["3513"] = "33 33 535", ["3514"] = "33 33 535", ["3515"] = "33 33 55", ["3516"] = "33 33 55", ["3517"] = "33 33 44", ["3218"] = "33 33 212",
    	["3521"] = "33 31 55", ["3522"] = "33 31 14", ["3523"] = "33 33 535", ["3524"] = "33 33 535", ["3525"] = "33 31 55", ["3525C"] = "33 33 55", ["3526"] = "33 31 14", ["3527"] = "33 33 44", ["3528"] = "33 33 212",
    	["3531"] = "33 55 334", ["3532"] = "33 55 313", ["3533"] = "33 53 535", ["3534"] = "33 53 535", ["3535"] = "33 53 55", ["3536"] = "33 55 14", ["3537"] = "33 53 44", ["3538"] = "33 55 212",
    	["3541"] = "33 55 334", ["3542"] = "33 55 313", ["3543"] = "33 53 535", ["3544"] = "33 33 535", ["3545"] = "33 53 55", ["3546"] = "33 55 14", ["3547"] = "33 53 44", ["3548"] = "33 55 212", ["354A1"] = "33 53 55",
    	["3551"] = "33 33 55", ["3552"] = "33 33 14", ["3553"] = "33 33 535", ["3554"] = "33 33 535", ["3555"] = "33 53 55", ["3556"] = "33 55 14", ["3557"] = "33 33 44", ["3258"] = "33 55 212",
    	["355A2"] = "33 33 55", ["355A6"] = "33 33 55", ["355C1"] = "33 55 0", ["355C3"] = "33 53 535", ["355C4"] = "33 53 535", 
    	["3561"] = "33 53 55", ["3562"] = "33 53 14", ["3563"] = "33 53 535", ["3564"] = "33 33 535", ["3565"] = "33 53 55", ["3566"] = "33 55 14", ["3567"] = "33 53 44", ["3568"] = "33 55 212",
    	["356A2"] = "33 33 55", ["356A3"] = "33 33 55", ["356A5"] = "33 33 55", ["356A6"] = "33 33 55",	["356C2"] = "33 55 0",
    	["3571"] = "33 44 55", ["3572"] = "33 44 55", ["3573"] = "33 44 535", ["3574"] = "33 44 535", ["3575"] = "33 44 55", ["3576"] = "33 44 14", ["3577"] = "33 44 44", ["3578"] = "33 44 212",
    	["3581"] = "33 21 55", ["3582"] = "33 21 14", ["3583"] = "33 21 535", ["3584"] = "33 21 535", ["3585"] = "33 21 55", ["3586"] = "33 21 14", ["3587"] = "33 21 44", ["3588"] = "33 21 212",
    
    	["3611"] = "55 33 55", ["3612"] = "55 33 55", ["3613"] = "55 33 535", ["3614"] = "55 33 535", ["3615"] = "55 33 55", ["3616"] = "55 33 55", ["3617"] = "55 33 44", ["3218"] = "55 33 212",
        ["3621"] = "55 31 55", ["3622"] = "55 31 14", ["3623"] = "55 33 535", ["3624"] = "55 33 535", ["3625"] = "55 31 55", ["3625C"] = "55 33 55", ["3626"] = "55 31 14", ["3627"] = "55 33 44", ["3628"] = "55 33 212",
        ["3631"] = "55 55 334", ["3632"] = "55 55 313", ["3633"] = "55 53 535", ["3634"] = "55 53 535", ["3635"] = "55 53 55", ["3636"] = "55 55 14", ["3637"] = "55 53 44", ["3638"] = "55 55 212",
        ["3641"] = "55 55 334", ["3642"] = "55 55 313", ["3643"] = "55 53 535", ["3644"] = "55 33 535", ["3645"] = "55 53 55", ["3646"] = "55 55 14", ["3647"] = "55 53 44", ["3648"] = "55 55 212", ["364A1"] = "55 53 55",
        ["3651"] = "55 33 55", ["3652"] = "55 33 14", ["3653"] = "55 33 535", ["3654"] = "55 33 535", ["3655"] = "55 53 55", ["3656"] = "55 55 14", ["3657"] = "55 33 44", ["3658"] = "55 55 212",
        ["365A2"] = "55 33 55", ["365A6"] = "55 33 55", ["365C1"] = "55 55 0", ["365C3"] = "55 53 535", ["365C4"] = "55 53 535",
        ["3661"] = "55 53 55", ["3662"] = "55 53 14", ["3663"] = "55 53 535", ["3664"] = "55 33 535", ["3665"] = "55 53 55", ["3666"] = "55 55 14", ["3667"] = "55 53 44", ["3668"] = "55 55 212",
        ["366A2"] = "55 33 55", ["366A3"] = "55 33 55", ["366A5"] = "55 33 55", ["366A6"] = "55 33 55",    ["366C2"] = "55 55 0",
        ["3671"] = "55 44 55", ["3672"] = "55 44 55", ["3673"] = "55 44 535", ["3674"] = "55 44 535", ["3675"] = "55 44 55", ["3676"] = "55 44 14", ["3677"] = "55 44 44", ["3678"] = "55 44 212",
        ["3681"] = "55 21 55", ["3682"] = "55 21 14", ["3683"] = "55 21 535", ["3684"] = "55 21 535", ["3685"] = "55 21 55", ["3686"] = "55 21 14", ["3687"] = "55 21 44", ["3688"] = "55 21 212",
    
    	--according to p.104: 「陽去在陰去(5)、陽去(6)前有時變[33]」
        ["36A51"] = "33 33 55", ["36A52"] = "33 33 14", ["36A53"] = "33 33 535", ["36A54"] = "33 33 535", ["36A55"] = "33 53 55", ["36A56"] = "33 55 14", ["36A57"] = "33 33 44", ["36A58"] = "33 55 212",
        ["36A5A2"] = "33 33 55", ["36A5A6"] = "33 33 55", ["36A5C1"] = "33 55 0", ["36A5C3"] = "33 53 535", ["36A5C4"] = "33 53 535",
        ["36A61"] = "33 53 55", ["36A62"] = "33 53 14", ["36A63"] = "33 53 535", ["36A64"] = "33 33 535", ["36A65"] = "33 53 55", ["36A66"] = "33 55 14", ["36A67"] = "33 53 44", ["36A68"] = "33 55 212",
        ["36A6A2"] = "33 33 55", ["36A6A3"] = "33 33 55", ["36A6A5"] = "33 33 55", ["36A6A6"] = "33 33 55", ["36A6C2"] = "33 55 0",
    
    	["3711"] = "44 33 55", ["3712"] = "44 33 55", ["3713"] = "44 33 535", ["3714"] = "44 33 535", ["3715"] = "44 33 55", ["3716"] = "44 33 55", ["3717"] = "44 33 44", ["3218"] = "44 33 212",
    	["3721"] = "44 31 55", ["3722"] = "44 31 14", ["3723"] = "44 33 535", ["3724"] = "44 33 535", ["3725"] = "44 31 55", ["3725C"] = "44 33 55", ["3726"] = "44 31 14", ["3727"] = "44 33 44", ["3728"] = "44 33 212",
    	["3731"] = "44 44 334", ["3732"] = "44 44 313", ["3733"] = "44 53 535", ["3734"] = "44 53 535", ["3735"] = "44 53 55", ["3736"] = "44 55 14", ["3737"] = "44 53 44", ["3738"] = "44 55 212",
    	["3741"] = "44 44 334", ["3742"] = "44 44 313", ["3743"] = "44 53 535", ["3744"] = "44 33 535", ["3745"] = "44 53 55", ["3746"] = "44 55 14", ["3747"] = "44 53 44", ["3748"] = "44 55 212", ["374A1"] = "44 53 55",
    	["3751"] = "44 33 55", ["3752"] = "44 33 14", ["3753"] = "44 33 535", ["3754"] = "44 33 535", ["3755"] = "44 53 55", ["3756"] = "44 55 14", ["3757"] = "44 33 44", ["3758"] = "44 55 212",
    	["375A2"] = "44 33 55", ["375A6"] = "44 33 55", ["375C1"] = "44 55 0", ["375C3"] = "44 53 535", ["375C4"] = "44 53 535",
    	["3761"] = "44 53 55", ["3762"] = "44 53 14", ["3763"] = "44 53 535", ["3764"] = "44 33 535", ["3765"] = "44 53 55", ["3766"] = "44 55 14", ["3767"] = "44 53 44", ["3768"] = "44 55 212",
    	["376A2"] = "44 33 55", ["376A3"] = "44 33 55", ["376A5"] = "44 33 55", ["376A6"] = "44 33 55",	["376C2"] = "44 55 0",
    	["3771"] = "44 44 55", ["3772"] = "44 44 55", ["3773"] = "44 44 535", ["3774"] = "44 44 535", ["3775"] = "44 44 55", ["3776"] = "44 44 14", ["3777"] = "44 44 44", ["3778"] = "44 44 212",
    	["3781"] = "44 21 55", ["3782"] = "44 21 14", ["3783"] = "44 21 535", ["3784"] = "44 21 535", ["3785"] = "44 21 55", ["3786"] = "44 21 14", ["3787"] = "44 21 44", ["3788"] = "44 21 212",
    
    	["3811"] = "21 33 55", ["3812"] = "21 33 55", ["3813"] = "21 33 535", ["3814"] = "21 33 535", ["3815"] = "21 33 55", ["3816"] = "21 33 55", ["3817"] = "21 33 44", ["3218"] = "21 33 212",
    	["3821"] = "21 31 55", ["3822"] = "21 31 14", ["3823"] = "21 33 535", ["3824"] = "21 33 535", ["3825"] = "21 31 55", ["3825C"] = "21 33 55", ["3826"] = "21 31 14", ["3827"] = "21 33 44", ["3828"] = "21 33 212",
    	["3831"] = "21 44 334", ["3832"] = "21 44 313", ["3833"] = "21 53 535", ["3834"] = "21 53 535", ["3835"] = "21 53 55", ["3836"] = "21 55 14", ["3837"] = "21 53 44", ["3838"] = "21 55 212",
    	["3841"] = "21 44 334", ["3842"] = "21 44 313", ["3843"] = "21 53 535", ["3844"] = "21 33 535", ["3845"] = "21 53 55", ["3846"] = "21 55 14", ["3847"] = "21 53 44", ["3848"] = "21 55 212", ["384A1"] = "21 53 55",
    	["3851"] = "21 33 55", ["3852"] = "21 33 14", ["3853"] = "21 33 535", ["3854"] = "21 33 535", ["3855"] = "21 53 55", ["3856"] = "21 55 14", ["3857"] = "21 33 44", ["3858"] = "21 55 212",
    	["385A2"] = "21 33 55", ["385A6"] = "21 33 55", ["385C1"] = "21 55 0", ["385C3"] = "21 53 535", ["385C4"] = "21 53 535",
    	["3861"] = "21 53 55", ["3862"] = "21 53 14", ["3863"] = "21 53 535", ["3864"] = "21 33 535", ["3865"] = "21 53 55", ["3866"] = "21 55 14", ["3867"] = "21 53 44", ["3868"] = "21 55 212",
    	["386A2"] = "21 33 55", ["386A3"] = "21 33 55", ["386A5"] = "21 33 55", ["386A6"] = "21 33 55", ["386C2"] = "21 55 0",
    	["3871"] = "21 44 55", ["3872"] = "21 44 55", ["3873"] = "21 44 535", ["3874"] = "21 44 535", ["3875"] = "21 44 55", ["3876"] = "21 44 14", ["3877"] = "21 4 44", ["3878"] = "21 44 212",
    	["3881"] = "21 21 55", ["3882"] = "21 21 14", ["3883"] = "21 21 535", ["3884"] = "21 21 535", ["3885"] = "21 21 55", ["3886"] = "21 21 14", ["3887"] = "21 21 44", ["3888"] = "21 21 212",
    
    	--PREDICATE-OBJECT SANDHI (述賓式) p. 105
    	--EACH BLOCK MARKED WITH P AFTER END SYLLABLE FOR NOW. CAN CHANGE LATER ACCORDING TO CODE SPECIFICS
    	--DISYLLABIC ONLY
    	["211P"] = "33 334", ["212P"] = "33 313", ["213P"] = "33 535", ["214P"] = "33 535", ["215P"] = "33 55", ["216P"] = "33 14", ["217P"] = "33 44", ["218P"] = "33 212",
        ["221P"] = "33 334", ["222P"] = "33 313", ["223P"] = "33 535", ["224P"] = "33 535", ["225P"] = "31 55", ["225CP"] = "33 55", ["226P"] = "33 14", ["227P"] = "33 44", ["228P"] = "33 212",
        ["231P"] = "55 334", ["232P"] = "55 313", ["233P"] = "53 535", ["234P"] = "53 535", ["235P"] = "53 55", ["236P"] = "55 14", ["237P"] = "53 44", ["238P"] = "55 212",
        ["241P"] = "55 334", ["242P"] = "55 313", ["243P"] = "53 535", ["244P"] = "33 535", ["245P"] = "53 55", ["246P"] = "55 14", ["247P"] = "534 44", ["248P"] = "55 212", ["24A1P"] = "53 55",
        ["251P"] = "33 334", ["252P"] = "33 313", ["253P"] = "33 535", ["254P"] = "33 535", ["255P"] = "33 55", ["256P"] = "33 14", ["257P"] = "33 44", ["258P"] = "55 212",
        ["25C1P"] = "55 334", ["25C2P"] = "55 313",
        ["261P"] = "55 334", ["262P"] = "55 313", ["263P"] = "53 535", ["264P"] = "33 535", ["265P"] = "53 55", ["266P"] = "55 14", ["267P"] = "53 44", ["268P"] = "55 212",
        ["271P"] = "44 334", ["272P"] = "44 313", ["273P"] = "44 535", ["274P"] = "44 535", ["275P"] = "44 55", ["276P"] = "44 14", ["277P"] = "44 44", ["278P"] = "44 212",
        ["281P"] = "21 334", ["282P"] = "21 313", ["283P"] = "21 535", ["284P"] = "21 535", ["285P"] = "21 55", ["286P"] = "21 14", ["287P"] = "21 44", ["288P"] = "21 212",
    	--Also like half of this is basically the same as the word tone sandhi. i've kept most patterns that are identical to the word tone sandhis here in the P table, but if needs be and they end up being redundancies i can remove the duplicate ones (might end up with the input acting up but eh)
    	--none of the 24x's are different from word tone so that row is directly deleteable if its not gonna be useful
    
    	--CLASSIFIER SANDHI (數量式) pp.105-106
    	--THE ACTUAL NUMBERS THEMSELVES TAKE ON WORD SANDHI
    	--CITATION TONE OF THE BOUNDARY CHARACTER + CITATION TONE OF CLASSIFIER CHARACTER -> BOTH DETERMINE THE POST-SANDHI VALUE ON THE CLASSIFIER CHARACTER TOGETHER.
    	--MOST LIKELY WE WILL NEED SOME KIND OF AN ALGORITHM+OPERATOR TO CHECK THE !!!CITATION!!! TONE CATEGORY OF THESE TWO CHARACTERS, BEFORE GETTING FROM THIS DATA TO CALCULATE THE CORRECT POST-SANDHI TONE FOR THE CLASSIFIER.
    	["11#1"] = "55", ["13#1"] = "55", ["14#1"] = "55", ["15#1"] = "55", ["16#1"] = "55", ["17#1"] = "55", ["18#1"] = "55", 
    	["11#2"] = "55", ["13#2"] = "313", ["14#2"] = "313", ["15#2"] = "313", ["16#2"] = "313", ["17#2"] = "55", ["17A#2"] = "313", ["18#2"] = "313", 
    	["11#3"] = "55", ["13#3"] = "55", ["14#3"] = "55", ["15#3"] = "55", ["16#3"] = "55", ["17#3"] = "55", ["18#3"] = "55", 
    	["11#4"] = "55", ["13#4"] = "14", ["14#4"] = "14", ["15#4"] = "14", ["16#4"] = "14", ["17#4"] = "55", ["17A#4"] = "14", ["18#4"] = "14", 
    	["11#5"] = "55", ["13#5"] = "55", ["14#5"] = "55", ["15#5"] = "55", ["16#5"] = "55", ["17#5"] = "55", ["18#5"] = "55", 
    	["11#6"] = "55", ["13#6"] = "14", ["14#6"] = "14", ["15#6"] = "14", ["16#6"] = "14", ["17#6"] = "55", ["17A#6"] = "14", ["18#6"] = "14", 
    	["11#7"] = "44", ["13#7"] = "44", ["14#7"] = "44", ["15#7"] = "44", ["16#7"] = "44", ["17#7"] = "44", ["18#7"] = "44", 
    	["11#8"] = "44", ["13#8"] = "212", ["14#8"] = "212", ["15#8"] = "212", ["16#8"] = "212", ["17#8"] = "44", ["17A#8"] = "212", ["18#8"] = "212", 
    	--no 12#x because there is no number word that is tone 2
    	--17A#2/4/6/8 - for 一 - this behaves differently from 百 and 七.
    	--一+classifier - 17#x for 1/3/5/7, 一&2 -> 7iq&2[...] (4 313), 一&4 -> 7iq&6[...]4 (4 313), 一&6 -> 7iq&6[...] (4 14), 一&8 -> 7iq&8[...] (4 212)
    
    	--NONCONCRETE TAIL~NEUTRALISED TAIL SANDHI (實虛式) pp.106-108
    	--mark with N? but clashes with numeral (n) in northern wu sandbox and c for numeral-classifier also clashes with 5C etc in word tone
    	--OK yknow what i'm using T for this
    	["211T"] = "33 55", ["212T"] = "33 55", ["213T"] = "33 55", ["214T"] = "33 55", ["215T"] = "33 55", ["216T"] = "33 55", ["217T"] = "33 44", ["218T"] = "33 212",
        ["221T"] = "33 55", ["222T"] = "31 55", ["223T"] = "31 55", ["223AT"] = "53 55", ["224T"] = "31 55", ["224AT"] = "31 14", ["225T"] = "31 55", ["225CT"] = "33 55", ["226T"] = "31 14", ["227T"] = "33 44", ["228T"] = "33 212",
        ["231T"] = "55 334", ["232T"] = "53 14", ["232AT"] = "55 14", ["233T"] = "53 55", ["234T"] = "53 55", ["235T"] = "53 55", ["236T"] = "55 14", ["237T"] = "53 44", ["238T"] = "55 212",
        ["241T"] = "55 334", ["242T"] = "55 313", ["243T"] = "53 535", ["244T"] = "55 14", ["245T"] = "53 55", ["246T"] = "55 14", ["247T"] = "534 44", ["248T"] = "55 212", ["24A1T"] = "53 55",
        ["251T"] = "33 55", ["252T"] = "33 14", ["253T"] = "33 55", ["254T"] = "33 14", ["255T"] = "55 0", ["256T"] = "55 0", ["257T"] = "33 44", ["258T"] = "55 0",
        ["25A2T"] = "33 55", ["25A6T"] = "33 55", ["25C1T"] = "55 0", ["25C3T"] = "53 535", ["25C4T"] = "53 535",
        ["261T"] = "53 55", ["262T"] = "53 14", ["263T"] = "53 535", ["264T"] = "14 0", ["265T"] = "53 55", ["266T"] = "14 0", ["267T"] = "53 44", ["268T"] = "55 212",
        ["26A2T"] = "33 55", ["26A3T"] = "33 55", ["26A5T"] = "33 55", ["26A6T"] = "33 55", ["26C2T"] = "55 0",
        ["271T"] = "44 0", ["272T"] = "44 55", ["273T"] = "44 535", ["274T"] = "44 535", ["275T"] = "44 55", ["276T"] = "44 55", ["277T"] = "44 44", ["278T"] = "44 212",
        ["281T"] = "21 55", ["282T"] = "21 14", ["283T"] = "21 55", ["284T"] = "21 55", ["284AT"] = "21 14", ["285T"] = "21 55", ["286T"] = "21 14", ["287T"] = "21 44", ["288T"] = "21 212",
    	--25Ax, 25Cx, 26Ax and 26Cx all same as word sandhi
    	--there are some 2xxAT's in here, which i'm not sure if it's going to be a problem but for what its worth
    
    	--ERHUA DIMINUTIVE TONES (小稱調) p. 110
    	--i'm marking this with an xR for now
    	--1R 2R 5R 6R = no change from original tone. can delete if need be
    	["1R"] = "334", ["2R"] = "313", ["3R"] = "55", ["4R"] = "14", ["5R"] = "55", ["5AR"] = "535", ["6R"] = "14", ["7R"] = "55", ["8R"] = "14", 
    }
    
    --diagnose_tones (if needed)
    
    local function tone_superscript(text)
    	return text:gsub('[1-5]',{['1']='¹',['2']='²',['3']='³',['4']='⁴',['5']='⁵'})
    end
    
    -- TODO: RPS
    local function get_tone(text)
    	text = text:gsub("(%d)%l+%d","%1"):gsub("%l+","")
    	local word_length = text:gsub("[^ ]+",""):len() + 1
    	local _, erhua = text:gsub("R","")
    	local result = tone_contours[word_length .. text:gsub("[ R]+","")] or
    		error("Tone input incorrect: " .. word_length .. text:gsub("[ R]+",""))
    	if erhua > 0 then
    		local tone = text:match("%dA?R")
    		result = result:gsub("%d+$",tone_contours[tone])
    	end
    	return tone_superscript(result)
    end
    
    local function rom_check(text) --this checks wugniu
    	if text:match('ghi') then
    		error('Invalid initial "ghi". Use "yi" instead.')
    	end
    	if text:match('ghu') then
    		error('Invalid initial "ghu". Use "wu" instead.')
    	end
    	if text:match('%f[%l]y%f[%L]') then
    		error('Invalid syllable "y"')
    	end
    	if text:match('gn[aeou]') then
    		error('Palatalization expected. Insert an "i" after the "gn".')
    	end
    	return nil
    end
    
    function export.make(text, w_count)
    	rom_check(text)
    	-- preprocess
    	local ipa_text = text
    		:gsub(" (%l+)(%d%u*)", " %2%1")
    		:gsub("(%d%u?)(%l+)#", "%1%2&%1#")
    	local format_text = text
    		:gsub("([34567])[AC]?", function(tone) return tone == "4" and "3" or tone end)
    		:gsub("#","&")
    		:gsub("[PT]","")
    	format_text = w_pron.wugniu_format(format_text)
    		:gsub("R","R")
    	
    	local show
    	if not w_count or w_count > 1 then
    		show = '\n** <small>(' .. w_pron.name_boilerplate('Jinhua') .. ')</small>'
    	else
    		show = ' <small>(' .. w_pron.name_boilerplate('Jinhua') .. ', <i>[[Wiktionary:About Chinese/Wu|Wugniu]]</i>)</small>'
    	end
    	local hide = '\n** <small>(' .. w_pron.name_boilerplate('Jinhua') .. ')</small>'
    	show = show .. ': ' .. w_pron.consolas(format_text)
    	hide = hide .. w_pron.wugniu_boilerplate(format_text)
    		.. w_pron.IPA_boilerplate(w_pron.wugniu_to_ipa(ipa_text, 'jh', get_initial, get_final, ipa_syllabic, get_tone), 'Jinhua')
    	return show,hide
    end
    
    return export