Modifica di Modulo:Fan-pronunciation
⧼vector-jumptonavigation⧽
⧼vector-jumptosearch⧽
Attenzione: non hai effettuato l'accesso. Se effettuerai delle modifiche il tuo indirizzo IP sarà visibile pubblicamente. Se accedi o crei un'utenza, le tue modifiche saranno attribuite al tuo nome utente, insieme ad altri benefici.
Questa modifica può essere annullata.
Controlla le differenze mostrate sotto fra le due versioni per essere certo che il contenuto corrisponda a quanto desiderato, e quindi salvare le modifiche per completare la procedura di annullamento.
Versione attuale | Il tuo testo | ||
Riga 22: | Riga 22: | ||
--sč at the end of a word is /ʃ/ | --sč at the end of a word is /ʃ/ | ||
word = word:gsub("sč","ʃ") | word = word:gsub("sč","ʃ") | ||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
if mw.ustring.find(word,"â") then | if mw.ustring.find(word,"â") then | ||
Riga 50: | Riga 45: | ||
end | end | ||
− | -- Transcriptions must contain an acute or grave, to indicate stress | + | -- Transcriptions must contain an acute or grave, to indicate stress position. |
-- This does not handle phrases containing more than one stressed word. | -- This does not handle phrases containing more than one stressed word. | ||
-- Default to penultimate stress rather than throw error? | -- Default to penultimate stress rather than throw error? | ||
if not mw.ustring.find(decomposed, acute_or_grave) then | if not mw.ustring.find(decomposed, acute_or_grave) then | ||
− | + | -- Allow monosyllabic unstressed words. | |
− | + | local vowel_count = select(2, decomposed:gsub("[æaeiou]", "%1")) | |
− | + | if vowel_count ~= 1 then | |
− | + | -- Add acute accent on second-to-last vowel. | |
− | + | decomposed = mw.ustring.gsub(decomposed, | |
− | + | "(" .. vowel .. ")(" .. not_vowel .. "*" .. vowel .. not_vowel .. "*)$", | |
− | + | "%1" .. mw.ustring.char(0x301) .. "%2") | |
− | + | else | |
− | + | decomposed=mw.ustring.gsub(decomposed,"(".. vowel ..")(" .. not_vowel .. "*)$",'%1' ..mw.ustring.char(0x301).. '%2') | |
− | + | end | |
− | + | end | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
local transcription = decomposed | local transcription = decomposed | ||
Riga 286: | Riga 273: | ||
"([kg])(" .. front .. ")", | "([kg])(" .. front .. ")", | ||
"%1" .. fronted .. "%2") | "%1" .. fronted .. "%2") | ||
− | :gsub("a", " | + | :gsub("a", "ä") |
:gsub("n", "n̺") -- Converts n before a consonant, which is incorrect. | :gsub("n", "n̺") -- Converts n before a consonant, which is incorrect. | ||