Jump to content

Module:de-IPA/testcases

From Wiktionary, the free dictionary

80 of 88 tests failed. (refresh)

TextExpectedActualDiffers at
test_pron:
FailedVaterˈfaːtɐfɐtər1
FailedAnnaˈanaɐnɐ1
PassedSaalzaːlzaːl
FailedQualkʋaːlkʋɐl3
Failedlokal, orig=romloˈkaːllɔkɐl2
FailedSargzaɐ̯kzɐrk2
Failedharthaɐ̯thɐrt2
FailedWaiseˈʋaɪ̯zəʋaɪ̯zə1
FailedSchlächterˈʃlɛçtɐʃlɛçtər1
Failedgäbeˈgɛːbəɡɛbə1
FailedKäseˈkɛːzəkɛzə1
FailedAuswahlˈaʊ̯sʋaːlaʊ̯sʋaːl1
FailedZahlenˈtsaːlənt͡saːlən1
Failedwählenˈʋɛːlənʋɛːlən1
Failedbrauchenˈbraʊ̯xənbraʊ̯χən1
Failedgleichenˈglaɪ̯çənɡlaɪ̯çən1
FailedArchenˈaɐ̯çənɐrçən1
FailedAachenˈaːχənaːχən1
Passedsolchzɔlçzɔlç
FailedWachtʋaχtʋɐχt2
Passeddochdɔχdɔχ
FailedStadtʃtatʃtɐt3
FailedDschungelˈdʒʊŋəlt͡ʃʊŋəl1
Failedlesenˈleːzənləzən1
Failedleckerˈlɛkɐləkər1
FailedErde (respelled Ērde)ˈeːɐ̯dəeːrdə1
Failedwerdenˈʋɛɐ̯dənʋərdən1
Failedabendlichˈabəntlɪçɐbəndlɪç1
FailedReichstag (respelled Reichs/tag)ˈraɪ̯çstaːkraɪ̯kstɐk1
FailedEicheˈaɪ̯çəaɪ̯çə1
Failedoderˈoːdɐɔdər1
PassedHundhʊnthʊnt
Failedsehenzeːnzeːhən4
Passednahnaːnaː
FailedNische (respelled Nīsche), orig=romˈniːʃəniːʃə1
Failedmischeˈmɪʃəmɪʃə1
Failedspielenˈʃpiːlənʃpiːlən1
FailedTiertiːɐ̯tiːr4
FailedÖsterreich (respelled Ȫster/reich)ˈøːstɐraɪ̯çœːʃtərraɪ̯ç1
Failedköstlichˈkœstlɪçkœʃtlɪç1
Failedöffnenˈœfnənœffnən1
Failedhöreˈhøːrəhœrə1
Failedhörthœɐ̯thœrt3
FailedPlörreˈplœrəplœrrə1
FailedQuatschkʋatʃkʋɐt͡ʃ3
Failedaßenˈaːsənɐən1
PassedHaushaʊ̯shaʊ̯s
FailedHauseˈhaʊ̯zəhaʊ̯zə1
Failedlasenˈlaːzənlɐzən1
Failedmassigˈmasɪçmɐszɪk1
PassedTischtɪʃtɪʃ
Failedscheußlichˈʃɔʏ̯slɪçʃɔʏ̯lɪç1
FailedAscheˈaʃəɐʃə1
FailedQuatschkʋatʃkʋɐt͡ʃ3
FailedBuchbuːxbʊχ2
FailedKussesˈkʊsəskʊszəs1
FailedFurchtfʊɐ̯çtfʊrçt3
FailedUhruːɐ̯uːr3
FailedBücherˈbyːçɐbʏçər1
FailedBrückeˈbrʏkəbrʏkə1
FailedTürtyːɐ̯tʏr2
FailedVogelˈfoːgəlfɔɡəl1
FailedVase, orig=romˈʋaːzəfɐzə1
Failedadministrativ, orig=romˌatmɪnɪstraˈtifɐtmɪnɪʃtrɐtɪf1
Failedselektiv, orig=romzeˌlɛkˈtifzələktɪf2
FailedMöweˈmøːʋəmœʋə1
Failedwasʋasʋɐs2
Failedgeglichengəˈglɪçənɡəɡlɪçən1
Failedangeglichenˈangəˌglɪçənɐŋəɡlɪçən1
Failedaufgebenˈaʊ̯fˌɡeːbənaʊ̯fɡəbən1
Failedaufgegebenˈaʊ̯fɡəˌɡeːbənaʊ̯fɡəɡəbən1
FailedMächtigkeitˈmɛçtɪçˌkaɪ̯tmɛçtɪkaɪ̯t1
Failedeventuell (respelled evéntuèll), orig=romeˈʋɛntuˌɛlləfˈəntˌʏll1
FailedEnklave, orig=romɛnˈklaːʋəəŋklɐfə1
FailedPhonem, orig=romfoˈneːmfɔnəm2
FailedChemie, orig=romçeˈmiːçəmiː2
FailedInformation, orig=romˌɪnfoɐ̯maˈtsi̯oːnɪnfɔrmɐtɪɔn1
FailedPlatin (respelled Plátin), orig=romˈplaːtinplˈaːtɪn1
FailedQualität, orig=romˌkʋaliˈtɛːtkʋɐlɪtɛt1
FailedRasur, orig=romraˈzuːɐ̯rɐzʊr2
Failedrasieren, orig=romraˈziːrənrɐziːrən2
Failedprogrammieren, orig=romˌprograˈmiːrənprɔɡrɐmmiːrən1
FailedBuchstabe (respelled Buch/stabe)ˈbuːxʃtaːbəbʊχʃtɐbə1
FailedUrheberrecht (respelled Ur/heber/rècht)ˈuːɐ̯heːbɐˌrɛçtʊrhəbərrˌəçt1
FailedStandartenführer (respelled Standárten/führer)ʃtanˈdartənˌfyːrɐʃtɐndˈɐrtənfyːrər3
FailedAufenthaltsgenehmigung (respelled Aufenthalts/genehmigung)ˈaʊ̯fɛnthaltsɡəˌneːmiɡʊŋaʊ̯fənthɐltsɡəneːmɪɡʊŋk1
Passeddoofdoːfdoːf
Faileddoofes (respelled doowes)ˈdoːʋəsdoːʋəs1

local tests = require('Module:UnitTests')
local m_de_IPA = require('Module:de-IPA')
local m_links = require('Module:links')

local lang = require('Module:languages').getByCode('de')

local function tag_IPA(IPA)
	return '<span class="IPA">' .. IPA .. '</span>'
end

function tests:check_pron(De, IPA, respelling, orig)
	self:equals(
		m_links.full_link({term = De, lang = lang}, nil, true) ..
			(respelling and (" (respelled " .. respelling .. ")") or "") ..
			(orig and ", orig=" .. orig or ""),
		m_de_IPA.toIPA(respelling or De, orig) or "NULL", IPA,
		{ nowiki=true, display = tag_IPA }
	)
end

-- Entries here usually look like
--    self:check_pron("GERMAN", "PRONUNCIATION")
--
-- but can also be
--    self:check_pron("GERMAN", "PRONUNCIATION", "RESPELLED-GERMAN")
--
-- e.g.
--    self:check_pron("Erde", "ˈeːɐ̯də", "Ehrde")
--    self:check_pron("Reichstag", "ˈraɪ̯çstaːk", "Reichs/tag")

-- A fourth argument can be specified to indicate Romance origin, which
--      causes certain changes like ultimate or penultimate stress and
--      interpreting ''v'' as /v/ instead of /f/:
--    self:check_pron("GERMAN", "PRONUNCIATION", nil, "rom")
--    self:check_pron("GERMAN", "PRONUNCIATION", "RESPELLED-GERMAN", "rom")
--
-- e.g.
--    self:check_pron("Phonem", "foˈneːm", nil, "rom")
--    self:check_pron("Enklave", "ɛnˈklaːʋə", nil, "rom")
--
-- Note: Broad transcription transcribes ⟨r⟩ as /r/, although /ʁ/ is the commonest actual pronunciation.

function tests:test_pron()
	local examples = {
		-- A:
		{ "Vater", "ˈfaːtɐ" },
		{ "Anna", "ˈana" },
		{ "Saal", "zaːl" },
		{ "Qual", "kʋaːl" },
		{ "lokal", "loˈkaːl", nil, "rom" },
		{ "Sarg", "zaɐ̯k" },
		{ "hart", "haɐ̯t" },
		{ "Waise", "ˈʋaɪ̯zə" },
		-- Ä
		{ "Schlächter", "ˈʃlɛçtɐ" },
		{ "gäbe", "ˈgɛːbə" },
		{ "Käse", "ˈkɛːzə" }, -- Possibly must be /eː/. Native status of ɛː is debated. I think most professional readers speak as written, but my understanding is that the spelling does not reflect any actual spoken language consistently. /ɛː/ is so absent here that my brain parses [ɛː] as [eː]
		-- AH 
		{ "Auswahl", "ˈaʊ̯sʋaːl" },
		{ "Zahlen", "ˈtsaːlən" },
		-- ÄH 
		{ "wählen", "ˈʋɛːlən" }, -- Could be /veːlən/, see Käse
 		-- AU:
		{ "brauchen", "ˈbraʊ̯xən" },
		--CH
		{ "gleichen", "ˈglaɪ̯çən" },
		{ "Archen", "ˈaɐ̯çən" },
		{ "Aachen", "ˈaːχən" },
		{ "solch", "zɔlç" },
		{ "Wacht", "ʋaχt" },
		{ "doch", "dɔχ" },
		-- D
		{ "Stadt", "ʃtat" },
		-- DSCH
		{ "Dschungel", "ˈdʒʊŋəl" },
		-- E:
		{ "lesen", "ˈleːzən" },
		{ "lecker", "ˈlɛkɐ" },
		{ "Erde", "ˈeːɐ̯də", "Ērde" },
		{ "werden", "ˈʋɛɐ̯dən" },
		{ "abendlich", "ˈabəntlɪç" },
		-- EI:
		{ "Reichstag", "ˈraɪ̯çstaːk", "Reichs/tag" },
		{ "Eiche", "ˈaɪ̯çə" },
		-- ER:
		{ "oder", "ˈoːdɐ" },
		-- H
		{ "Hund", "hʊnt" },
		{ "sehen", "zeːn" }, -- You often see /zeːən/, which is hypercorrect spelling-pron., might be standard anyway.
		{ "nah", "naː" },
		-- I
		{ "Nische", "ˈniːʃə", "Nīsche", "rom" }, -- Borrowing
		{ "mische", "ˈmɪʃə" }, -- native
		-- IE:
		{ "spielen", "ˈʃpiːlən" },
		{ "Tier", "tiːɐ̯" }, -- This pronunciation is pretty wrong and would be understood as 'Tia', but I think it's the expected transcription. The actual level of the r-vowel raises with the preceding vowel.
		-- Ö:
		{ "Österreich", "ˈøːstɐraɪ̯ç", "Ȫster/reich" },
		{ "köstlich", "ˈkœstlɪç" },
		{ "öffnen", "ˈœfnən" },
		{ "höre", "ˈhøːrə" },
		{ "hört", "hœɐ̯t" },
		{ "Plörre", "ˈplœrə" },
		-- QU:
		{ "Quatsch", "kʋatʃ" }, -- Must be [kfatʃ] if /v/ is used instead of /ʋ/
		-- S/ß: 
		{ "aßen", "ˈaːsən" },
		{ "Haus", "haʊ̯s" },	
		{ "Hause", "ˈhaʊ̯zə" },
		{ "lasen", "ˈlaːzən" },
		{ "massig", "ˈmasɪç" },
		-- SCH:
		{ "Tisch", "tɪʃ" },
		{ "scheußlich", "ˈʃɔʏ̯slɪç" },
		{ "Asche", "ˈaʃə" },
		-- TSCH:
		{ "Quatsch", "kʋatʃ" },
		-- U
		{ "Buch", "buːx" },
		{ "Kusses", "ˈkʊsəs" },
		{ "Furcht", "fʊɐ̯çt" },
		-- UH:
		{ "Uhr", "uːɐ̯" },
		-- Ü
		{ "Bücher", "ˈbyːçɐ" },
		{ "Brücke", "ˈbrʏkə" },
		{ "Tür", "tyːɐ̯" },
		-- ÜH 
		-- V
		{ "Vogel", "ˈfoːgəl" },
		{ "Vase", "ˈʋaːzə", nil, "rom" }, -- Borrowing, should this have [v]?
		{ "administrativ", "ˌatmɪnɪstraˈtif", nil, "rom" }, -- Might have a long /i/; I can't tell since northern speech has no length distinction
		{ "selektiv", "zeˌlɛkˈtif", nil, "rom" },
		-- W
		{ "Möwe", "ˈmøːʋə" },
		{ "was", "ʋas" },
		-- Affixes (Stress)
		{ "geglichen", "gəˈglɪçən" },
		{ "angeglichen", "ˈangəˌglɪçən" },
		{ "aufgeben", "ˈaʊ̯fˌɡeːbən" }, -- should be smart enough not to interpret -ge- here as a prefix (because followed by -en
		{ "aufgegeben", "ˈaʊ̯fɡəˌɡeːbən" },
		{ "Mächtigkeit", "ˈmɛçtɪçˌkaɪ̯t" },
		-- Borrowed words with unexpected stress:
		{ "eventuell", "eˈʋɛntuˌɛll", "evéntuèll", "rom" }, -- Borrowing, should this have [v]?
		{ "Enklave", "ɛnˈklaːʋə", nil, "rom" }, -- Borrowing, should this have [v]?
		{ "Phonem", "foˈneːm", nil, "rom" },
		{ "Chemie", "çeˈmiː", nil, "rom" },
		{ "Information", "ˌɪnfoɐ̯maˈtsi̯oːn", nil, "rom" }, -- Notice how this Roman word uses /ɪ/
		{ "Platin", "ˈplaːtin", "Plátin", "rom" }, -- And this one doesn't.
		{ "Qualität", "ˌkʋaliˈtɛːt", nil, "rom" }, -- See Käse
		{ "Rasur", "raˈzuːɐ̯", nil, "rom" },
		{ "rasieren", "raˈziːrən", nil, "rom" },
		{ "programmieren", "ˌprograˈmiːrən", nil, "rom" },
		-- Slash separating compounds:
		{ "Buchstabe", "ˈbuːxʃtaːbə", "Buch/stabe" },
		{ "Urheberrecht", "ˈuːɐ̯heːbɐˌrɛçt", "Ur/heber/rècht" },
		{ "Standartenführer", "ʃtanˈdartənˌfyːrɐ", "Standárten/führer" },
		{ "Aufenthaltsgenehmigung", "ˈaʊ̯fɛnthaltsɡəˌneːmiɡʊŋ", "Aufenthalts/genehmigung" },
		-- Irregular borrowings:
		{ "doof", "doːf" },
		{ "doofes", "ˈdoːʋəs", "doowes" }, -- Borrowing, should this have [v]?
	}
	
	self:iterate(examples, "check_pron")
end

return tests

-- For Vim, so we get 4-space tabs
-- vim: set ts=4 sw=4 noet: