Модуль:uk-pron/testcases
Зовнішній вигляд
Документацію для цього модуля можна створити у Модуль:uk-pron/testcases/документація
local tests = require('Модуль:UnitTests')
local m_pron = require('Модуль:uk-pron')
local Ukrainian = require("Модуль:languages-data").getByCode("uk")
local Cyrillic = require("Модуль:scripts").getByCode("Cyrl")
local function tag_IPA(IPA)
return '<span class="IPA">' .. IPA .. '</span>'
end
function tests:check_pronunc(uk, ipa)
self:equals(require("Модуль:links").full_link{ term = uk, lang = Ukrainian, sc = Cyrillic }, m_pron.pronunciation(uk), ipa, { display = tag_IPA })
end
function tests:check_pronunc_noaccent(uk, ipa)
self:equals(require("Модуль:links").full_link{ term = uk, lang = Ukrainian, sc = Cyrillic }, m_pron.pronunciation(uk, "1"), ipa, { display = tag_IPA })
end
function tests:test_pronunciation_secondary_stress()
self:check_pronunc("а̀віаполі́т", "ˌɑʋʲiɐpoˈlʲit")
self:check_pronunc("нѐйробіоло́гія", "ˌnɛi̯rɔbʲiɔˈɫɔɣʲijɐ")
end
function tests:test_pronunciation_monosyllabic()
self:check_pronunc("бік", "bʲik")
self:check_pronunc("нема́ за́ що", "neˈmɑ ˈzɑ ʂʈ͡ʂɔ")
end
function tests:test_pronunciation_allophones_e_i()
self:check_pronunc("мене́", "meˈnɛ")
self:check_pronunc("мине́", "meˈnɛ")
end
function tests:test_pronunciation_allophones_j()
self:check_pronunc("хай", "xɑi̯")
self:check_pronunc("зна́йте", "ˈznɑi̯te")
self:check_pronunc("ча́йка", "ˈʈ͡ʂɑi̯kɐ")
self:check_pronunc("мій", "mʲii̯")
self:check_pronunc("йня́ти", "ˈi̯nʲɑte")
self:check_pronunc("йод", "jɔd")
self:check_pronunc("моя́", "mɔˈjɑ")
self:check_pronunc("мою́", "mɔˈju")
self:check_pronunc("моє́", "mɔˈjɛ")
self:check_pronunc("мої́", "mɔˈji")
end
function tests:test_pronunciation_allophones_v()
self:check_pronunc("мав", "mɑu̯")
self:check_pronunc("був", "buu̯")
self:check_pronunc("ма́впа", "ˈmɑu̯pɐ")
self:check_pronunc("шовк", "ʂɔu̯k")
self:check_pronunc("вниз", "wnɪz")
self:check_pronunc("вона́", "wɔˈnɑ")
self:check_pronunc("ву́хо", "ˈwuxɔ")
self:check_pronunc("впе́рше", "ˈʍpɛrʂe")
self:check_pronunc("він", "ʋʲin")
end
function tests:test_pronunciation_voicing_slovnik_no10()
self:check_pronunc("відділи́ти", "ʋʲidʲːiˈɫɪtɪ")
self:check_pronunc("надті́сувати", "nɐdʲˈtʲisʊʋɐtɪ")
end
function tests:test_pronunciation_voicing_slovnik_no6()
self:check_pronunc("боротьба́", "bɔrɔdʲˈbɑ")
end
function tests:test_pronunciation_assimilations_slovnik()
self:check_pronunc("ви́рісши", "ˈʋɪrʲiʂːɪ")
self:check_pronunc("ви́візши", "ˈʋɪʋʲiʐʂɪ")
self:check_pronunc("зши́ти", "ˈʂːɪtɪ")
self:check_pronunc("зжо́вкнути", "ˈʐːɔu̯knʊtɪ")
self:check_pronunc("безжа́лісний", "beˈʐːɑlʲisnɪi̯")
self:check_pronunc("безче́сний", "beʐˈʈ͡ʂɛsnɪi̯")
self:check_pronunc("зчи́стити", "ˈʂʈ͡ʂɪstetɪ")
end
function tests:test_pronunciation_assimilations_norm()
self:check_pronunc("відсі́ль", "ʋʲid͡zʲˈsʲilʲ")
self:check_pronunc("два́дцять", "ˈdʋɑd͡zʲt͡sʲɐtʲ")
self:check_pronunc("ро́биться", "ˈrɔbet͡sʲːɐ")
self:check_pronunc("кори́тця", "kɔˈrɪt͡sʲːɐ")
end
function tests:test_pronunciation_phonetic_lengthened_consonants()
self:check_pronunc("знання́", "znɐˈnʲːɑ")
self:check_pronunc("рілля́", "rʲiˈlʲːɑ")
self:check_pronunc("ті́нню", "ˈtʲinʲːʊ")
self:check_pronunc("ллю", "lʲːu")
self:check_pronunc("обби́ти", "ɔˈbːɪte")
self:check_pronunc("зако́нний", "zɐˈkɔnːei̯")
self:check_pronunc("вітчи́зна", "ʋʲiˈʈ͡ʂːɪznɐ")
self:check_pronunc("болі́тце", "boˈlʲit͡sːe")
self:check_pronunc("ви́нісши", "ˈʋɪnʲiʂːɪ")
self:check_pronunc("зжува́ти", "ʐːʊˈʋɑtɪ")
self:check_pronunc("бере́шся", "beˈrɛsʲːɐ")
self:check_pronunc("бері́ться", "beˈrʲit͡sʲːɐ")
end
function tests:test_pronunciation_phonetic_simplification()
self:check_pronunc("студе́нтський", "stʊˈdɛnʲsʲkɪi̯")
self:check_pronunc("тури́стський", "tʊˈrɪsʲkɪi̯")
self:check_pronunc("аге́нтство", "ɐˈɣɛnstwɔ")
self:check_pronunc("солі́стці", "soˈlʲisʲt͡sʲ(ː)i")
self:check_pronunc("шістдеся́т", "ʂʲizdeˈsʲɑt")
self:check_pronunc("шістсо́т", "ʂʲiˈsːɔt")
end
function tests:test_pronunciation_phonetic_consonant_assimilations_Pugh_p36_37_38()
self:check_pronunc("кни́жка", "ˈknɪʐkɐ")
self:check_pronunc("кни́жці", "ˈknɪzʲt͡sʲi")
self:check_pronunc("дочка́", "dɔʈ͡ʂˈkɑ")
self:check_pronunc("дочці́", "dɔˈt͡sʲːi")
self:check_pronunc("чита́єш", "ʈ͡ʂeˈtɑjeʂ")
self:check_pronunc("сміє́шся", "sʲmʲiˈjɛsʲːɐ")
self:check_pronunc("до́шка", "ˈdɔʂkɐ")
self:check_pronunc("до́шці", "ˈdɔsʲt͡sʲi")
self:check_pronunc("безжа́лісний", "beˈʐːɑlʲisnɪi̯")
self:check_pronunc("підрі́сши", "pʲiˈdʲrʲiʂːɪ")
self:check_pronunc("кімна́тці", "kʲimˈnɑt͡sʲːi")
self:check_pronunc("крава́тці", "krɐˈʋɑt͡sʲːi")
self:check_pronunc("неві́стці", "neˈʋʲisʲt͡sʲ(ː)i")
self:check_pronunc("борі́дці", "boˈrʲid͡zʲt͡sʲi")
self:check_pronunc("лю́дський", "ˈlʲud͡zʲsʲkɪi̯")
-- Pugh p. 37 claims that it should be sɔlˈdɑt͡sʲsʲkɪj, but Орфоепскі словник p. 97 claims otherwise
self:check_pronunc("солда́тський", "sɔɫˈdɑt͡sʲkɪi̯")
end
function tests:test_pronunciation_phonetic_apostrophe_Pugh_p32()
self:check_pronunc("від'ї́зд", "ʋʲiˈdjizd")
self:check_pronunc("п'ю", "pju")
self:check_pronunc("ф'ю́кати", "ˈfjukɐtɪ")
self:check_pronunc("об'є́кт", "ɔˈbjɛkt")
self:check_pronunc("п'ять", "pjɑtʲ")
self:check_pronunc("здоро́в'я", "zdɔˈrɔʋjɐ")
self:check_pronunc("м'яки́й", "mjɐˈkɪi̯")
end
function tests:test_pronunciation_phonetic_Pugh_p29_p30()
self:check_pronunc("ти", "tɪ")
self:check_pronunc("ті", "tʲi")
self:check_pronunc("дя́кую", "ˈdʲɑkʊjʊ")
self:check_pronunc("сад", "sɑd")
self:check_pronunc("сядь", "sʲɑdʲ")
self:check_pronunc("пала́ц", "pɐˈɫɑt͡s")
self:check_pronunc("хло́пець", "ˈxɫɔpet͡sʲ")
self:check_pronunc("дзвін", "d͡zʲʋʲin")
self:check_pronunc("дзво́на", "ˈd͡zwɔnɐ")
self:check_pronunc("ра́са", "ˈrɑsɐ")
self:check_pronunc("ря́са", "ˈrʲɑsɐ")
self:check_pronunc("бі́лий", "ˈbʲiɫɪi̯")
self:check_pronunc("вів", "ʋʲiu̯")
self:check_pronunc("кінь", "kʲinʲ")
self:check_pronunc("шість", "ʂʲisʲtʲ")
self:check_pronunc("ножі́", "noˈʐʲi")
self:check_pronunc("уночі́", "ʊnoˈʈ͡ʂʲi")
self:check_pronunc("мі́сті", "ˈmʲisʲtʲi")
self:check_pronunc("одні́й", "odʲˈnʲii̯")
self:check_pronunc("сніг", "sʲnʲiɣ")
self:check_pronunc("люблю́", "lʲʊˈblʲu")
self:check_pronunc("коно́плі", "kɔˈnɔplʲi")
self:check_pronunc("графля́ть", "ɣrɐˈflʲɑtʲ")
self:check_pronunc("ко́рмлять", "ˈkɔrmlʲɐtʲ")
end
-- If a vowel, an apostrophe, or nothing precedes я, є, ю, then they represent [j] + [ɑ, ɛ, u].
function tests:test_pronunciation_phonetic_ja_je_ju()
self:check_pronunc("а́я", "ˈɑjɐ")
self:check_pronunc("ея́", "eˈjɑ")
self:check_pronunc("і́я", "ˈijɐ")
self:check_pronunc("ия́", "eˈjɑ")
self:check_pronunc("о́я", "ˈɔjɐ")
self:check_pronunc("уя́", "ʊˈjɑ")
self:check_pronunc("а́є", "ˈɑje")
self:check_pronunc("еє́", "eˈjɛ")
self:check_pronunc("і́є", "ˈije")
self:check_pronunc("иє́", "eˈjɛ")
self:check_pronunc("о́є", "ˈɔje")
self:check_pronunc("ую́", "ʊˈju")
self:check_pronunc("а́ю", "ˈɑjʊ")
self:check_pronunc("ею́", "eˈju")
self:check_pronunc("і́ю", "ˈijʊ")
self:check_pronunc("ию́", "eˈju")
self:check_pronunc("о́ю", "ˈɔjʊ")
self:check_pronunc("ую́", "ʊˈju")
self:check_pronunc_noaccent("'я", "jɐ")
self:check_pronunc_noaccent("'є", "je")
self:check_pronunc_noaccent("'ю", "jʊ")
self:check_pronunc_noaccent("я", "jɐ")
self:check_pronunc_noaccent("є", "je")
self:check_pronunc_noaccent("ю", "jʊ")
end
-- phonemic and subphonemic weak palatalization.
function tests:test_pronunciation_phonetic_softening_ja_je_ji_ju()
-- first 12 subphonemic: б п в ф м к г х ж ш ч щ дж ждж
self:check_pronunc("б", "b")
self:check_pronunc_noaccent("бі", "bʲi")
self:check_pronunc_noaccent("бя", "bʲɐ")
self:check_pronunc_noaccent("бє", "bʲe")
self:check_pronunc_noaccent("бю", "bʲʊ")
self:check_pronunc("п", "p")
self:check_pronunc_noaccent("пі", "pʲi")
self:check_pronunc_noaccent("пя", "pʲɐ")
self:check_pronunc_noaccent("пє", "pʲe")
self:check_pronunc_noaccent("пю", "pʲʊ")
self:check_pronunc("в", "ʋ")
self:check_pronunc_noaccent("ві", "ʋʲi")
self:check_pronunc_noaccent("вя", "ʋʲɐ")
self:check_pronunc_noaccent("вє", "ʋʲe")
self:check_pronunc_noaccent("вю", "ʋʲʊ")
self:check_pronunc("ф", "f")
self:check_pronunc_noaccent("фі", "fʲi")
self:check_pronunc_noaccent("фя", "fʲɐ")
self:check_pronunc_noaccent("фє", "fʲe")
self:check_pronunc_noaccent("фю", "fʲʊ")
self:check_pronunc("м", "m")
self:check_pronunc_noaccent("мі", "mʲi")
self:check_pronunc_noaccent("мя", "mʲɐ")
self:check_pronunc_noaccent("мє", "mʲe")
self:check_pronunc_noaccent("мю", "mʲʊ")
self:check_pronunc("к", "k")
self:check_pronunc_noaccent("кі", "kʲi")
self:check_pronunc_noaccent("кя", "kʲɐ")
self:check_pronunc_noaccent("кє", "kʲe")
self:check_pronunc_noaccent("кю", "kʲʊ")
self:check_pronunc("г", "ɣ")
self:check_pronunc_noaccent("гі", "ɣʲi")
self:check_pronunc_noaccent("гя", "ɣʲɐ")
self:check_pronunc_noaccent("гє", "ɣʲe")
self:check_pronunc_noaccent("гю", "ɣʲʊ")
self:check_pronunc("х", "x")
self:check_pronunc_noaccent("хі", "xʲi")
self:check_pronunc_noaccent("хя", "xʲɐ")
self:check_pronunc_noaccent("хє", "xʲe")
self:check_pronunc_noaccent("хю", "xʲʊ")
self:check_pronunc("ж", "ʐ")
self:check_pronunc_noaccent("жі", "ʐʲi")
self:check_pronunc_noaccent("жя", "ʐʲɐ")
self:check_pronunc_noaccent("жє", "ʐʲe")
self:check_pronunc_noaccent("жю", "ʐʲʊ")
self:check_pronunc("ш", "ʂ")
self:check_pronunc_noaccent("ші", "ʂʲi")
self:check_pronunc_noaccent("шя", "ʂʲɐ")
self:check_pronunc_noaccent("шє", "ʂʲe")
self:check_pronunc_noaccent("шю", "ʂʲʊ")
self:check_pronunc("ч", "ʈ͡ʂ")
self:check_pronunc_noaccent("чі", "ʈ͡ʂʲi")
self:check_pronunc_noaccent("чя", "ʈ͡ʂʲɐ")
self:check_pronunc_noaccent("чє", "ʈ͡ʂʲe")
self:check_pronunc_noaccent("чю", "ʈ͡ʂʲʊ")
self:check_pronunc("щ", "ʂʈ͡ʂ")
self:check_pronunc_noaccent("щі", "ʂʈ͡ʂʲi")
self:check_pronunc_noaccent("щя", "ʂʈ͡ʂʲɐ")
self:check_pronunc_noaccent("щє", "ʂʈ͡ʂʲe")
self:check_pronunc_noaccent("щю", "ʂʈ͡ʂʲʊ")
self:check_pronunc("дж", "ɖ͡ʐ")
self:check_pronunc_noaccent("джі", "ɖ͡ʐʲi")
self:check_pronunc_noaccent("джя", "ɖ͡ʐʲɐ")
self:check_pronunc_noaccent("джє", "ɖ͡ʐʲe")
self:check_pronunc_noaccent("джю", "ɖ͡ʐʲʊ")
self:check_pronunc("ждж", "ʐɖ͡ʐ")
self:check_pronunc_noaccent("жджі", "ʐɖ͡ʐʲi")
self:check_pronunc_noaccent("жджя", "ʐɖ͡ʐʲɐ")
self:check_pronunc_noaccent("жджє", "ʐɖ͡ʐʲe")
self:check_pronunc_noaccent("жджю", "ʐɖ͡ʐʲʊ")
---- 9 phonemic softenings: т д с з ц дз н л
self:check_pronunc("т", "t")
self:check_pronunc_noaccent("ті", "tʲi")
self:check_pronunc_noaccent("тя", "tʲɐ")
self:check_pronunc_noaccent("тє", "tʲe")
self:check_pronunc_noaccent("тю", "tʲʊ")
self:check_pronunc("д", "d")
self:check_pronunc_noaccent("ді", "dʲi")
self:check_pronunc_noaccent("дя", "dʲɐ")
self:check_pronunc_noaccent("дє", "dʲe")
self:check_pronunc_noaccent("дю", "dʲʊ")
self:check_pronunc("с", "s")
self:check_pronunc_noaccent("сі", "sʲi")
self:check_pronunc_noaccent("ся", "sʲɐ")
self:check_pronunc_noaccent("сє", "sʲe")
self:check_pronunc_noaccent("сю", "sʲʊ")
self:check_pronunc("з", "z")
self:check_pronunc_noaccent("зі", "zʲi")
self:check_pronunc_noaccent("зя", "zʲɐ")
self:check_pronunc_noaccent("зє", "zʲe")
self:check_pronunc_noaccent("зю", "zʲʊ")
self:check_pronunc("ц", "t͡s")
self:check_pronunc_noaccent("ці", "t͡sʲi")
self:check_pronunc_noaccent("ця", "t͡sʲɐ")
self:check_pronunc_noaccent("цє", "t͡sʲe")
self:check_pronunc_noaccent("цю", "t͡sʲʊ")
self:check_pronunc("дз", "d͡z")
self:check_pronunc_noaccent("дзі", "d͡zʲi")
self:check_pronunc_noaccent("дзя", "d͡zʲɐ")
self:check_pronunc_noaccent("дзє", "d͡zʲe")
self:check_pronunc_noaccent("дзю", "d͡zʲʊ")
self:check_pronunc("н", "n")
self:check_pronunc_noaccent("ні", "nʲi")
self:check_pronunc_noaccent("ня", "nʲɐ")
self:check_pronunc_noaccent("нє", "nʲe")
self:check_pronunc_noaccent("ню", "nʲʊ")
self:check_pronunc("л", "ɫ")
self:check_pronunc_noaccent("лі", "lʲi")
self:check_pronunc_noaccent("ля", "lʲɐ")
self:check_pronunc_noaccent("лє", "lʲe")
self:check_pronunc_noaccent("лю", "lʲʊ")
self:check_pronunc("р", "r")
self:check_pronunc_noaccent("рі", "rʲi")
self:check_pronunc_noaccent("ря", "rʲɐ")
self:check_pronunc_noaccent("рє", "rʲe")
self:check_pronunc_noaccent("рю", "rʲʊ")
end
function tests:test_pronunciation_phonetic_hard_soft_sign()
self:check_pronunc("т", "t")
self:check_pronunc("ть", "tʲ")
self:check_pronunc("д", "d")
self:check_pronunc("дь", "dʲ")
self:check_pronunc("с", "s")
self:check_pronunc("сь", "sʲ")
self:check_pronunc("з", "z")
self:check_pronunc("зь", "zʲ")
self:check_pronunc("ц", "t͡s")
self:check_pronunc("ць", "t͡sʲ")
self:check_pronunc("дз", "d͡z")
self:check_pronunc("дзь", "d͡zʲ")
self:check_pronunc("н", "n")
self:check_pronunc("нь", "nʲ")
self:check_pronunc("л", "ɫ")
self:check_pronunc("ль", "lʲ")
self:check_pronunc("п", "p")
self:check_pronunc("пь", "pʲ")
end
function tests:test_pronunciation_phonetic_dual_pronunciation_prefix_bez_roz()
self:check_pronunc("розписа́ти", "rɔzpeˈsɑtɪ")
self:check_pronunc("росписа́ти", "rɔspeˈsɑtɪ")
self:check_pronunc("безпла́тний", "bezˈpɫɑtnɪi̯")
self:check_pronunc("беспла́тний", "beˈspɫɑtnɪi̯")
end
function tests:test_pronunciation_phonetic_assimilation_voiceless_voiced()
self:check_pronunc("вокза́л", "wɔɡˈzɑɫ")
self:check_pronunc("якби́", "jɐɡˈbɪ")
self:check_pronunc("молотьба́", "mɔɫɔdʲˈbɑ")
self:check_pronunc("анекдо́т", "ɐneɡˈdɔt")
self:check_pronunc("при", "prɪ")
end
function tests:test_pronunciation_phonetic_basic()
self:check_pronunc("ходжу́", "xoˈɖ͡ʐu")
self:check_pronunc("джи́нси", "ˈɖ͡ʐɪnsɪ")
self:check_pronunc("дзе́ркало", "ˈd͡zɛrkɐɫɔ")
self:check_pronunc("дзво́ник", "ˈd͡zwɔnek")
self:check_pronunc("дзьоб", "d͡zʲɔb")
self:check_pronunc("агре́сія", "ɐˈɣrɛsʲijɐ")
self:check_pronunc("шви́дше", "ˈʂʋɪɖ͡ʐʂe")
self:check_pronunc("ї́жте", "ˈjiʐte")
self:check_pronunc("ро́зталь", "ˈrɔztɐlʲ")
self:check_pronunc("шви́дко", "ˈʂʋɪdkɔ")
self:check_pronunc("ніж", "nʲiʐ")
self:check_pronunc("ри́бка", "ˈrɪbkɐ")
self:check_pronunc("ка́зка", "ˈkɑzkɐ")
self:check_pronunc("ка́ска", "ˈkɑskɐ")
self:check_pronunc("залюбки́", "zɐlʲʊbˈkɪ")
self:check_pronunc("мед", "mɛd")
-- must be rʲ, error in the book p. 26
self:check_pronunc("скрізь", "skrʲizʲ")
-- word-initial stressed vowel; formerly not handled correctly
self:check_pronunc("О́сло", "ˈɔsɫɔ")
end
function tests:test_pronunciation_phonetic_diphonemic_dz_dzh_dsh_dch()
self:check_pronunc("піджжива́ти", "pʲiɖ͡ʐʐeˈʋɑtɪ")
self:check_pronunc("віджжи́лий", "ʋʲiɖ͡ʐˈʐɪɫɪi̯")
self:check_pronunc("підззе́мний", "pʲid͡zˈzɛmnɪi̯")
self:check_pronunc("підззира́ти", "pʲid͡zzeˈrɑtɪ")
self:check_pronunc("відшу́кувати", "ʋʲiɖ͡ʐˈʂukʊʋɐtɪ")
self:check_pronunc("відчуття́", "ʋʲiɖ͡ʐʈ͡ʂʊˈtʲːɑ")
self:check_pronunc("відці́джувати", "ʋʲid͡zʲˈt͡sʲiɖ͡ʐʊʋɐtɪ")
self:check_pronunc("відцвіта́ти", "ʋʲid͡zt͡sʲʋʲiˈtɑtɪ")
end
function tests:test_pronunciation_multiword_expressions()
-- initial stress in a medial word formerly not handled correctly
self:check_pronunc("Сполу́чені Шта́ти Аме́рики", "spoˈɫuʈ͡ʂenʲi ˈʂtɑtɪ ɐˈmɛrekɪ")
end
return tests