Modifiche

⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽

Modulo:Fan-pronunciation

626 byte aggiunti, 07:34, 23 dic 2018
nessun oggetto della modifica
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
 +
        if mw.ustring.find(word,"č") then
 +
          word = mw.ustring.toNFC(word)
 +
--sč at the end of a word is /ʧ/
 +
          word = word:gsub("č","ʧ")
 
         end
 
         end
 
         if mw.ustring.find(word,"â") then
 
         if mw.ustring.find(word,"â") then
Riga 45: Riga 50:  
end
 
end
 
 
-- Transcriptions must contain an acute or grave, to indicate stress position.
+
-- Transcriptions must contain an acute or grave, to indicate stress
 
-- 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?
Riga 51: Riga 56:  
         if not mw.ustring.find(decomposed, acute_or_grave) then
 
         if not mw.ustring.find(decomposed, acute_or_grave) then
 
      -- Allow monosyllabic unstressed words.
 
      -- Allow monosyllabic unstressed words.
    local vowel_count = select(2, decomposed:gsub("[æaeiou]", "%1"))
+
    --local vowel_count = select(2, decomposed:gsub("[æaeiou]", "%1"))
             transcriptio=mw.ustring.sub(decomposed,-1)
+
             --if vowel_count ~= 1 then
            if transcriptio ~= vowel then  
+
            transcriptio=mw.ustring.sub(decomposed,-1)
            decomposed=mw.ustring.gsub(decomposed,"(".. vowel ..")(" .. not_vowel .. "*)$",'%1' ..mw.ustring.char(0x301).. '%2')
+
            if transcriptio == 'a' then  
+
              decomposed = mw.ustring.gsub(decomposed,"(" .. vowel .. ")(" .. not_vowel .. "*" .. vowel .. not_vowel .."*)$","%1" .. mw.ustring.char(0x301) .. "%2")
-- Add acute accent on second-to-last vowel.
+
            --end
            --elseif vowel_count ~= 1 then
+
            elseif transcriptio =='e' then
            else
+
              decomposed = mw.ustring.gsub(decomposed,"(" .. vowel .. ")(" .. not_vowel .. "*" .. vowel .. not_vowel .."*)$","%1" ..  mw.ustring.char(0x301) .. "%2")
               decomposed = mw.ustring.gsub(decomposed,"(" .. vowel .. ")(" .. not_vowel .. "*" .. vowel .. not_vowel .."*)$","%1"  
+
            elseif transcriptio =='o' then  
               ..  mw.ustring.char(0x301) .. "%2")
+
               decomposed = mw.ustring.gsub(decomposed,"(" .. vowel .. ")(" .. not_vowel .. "*" .. vowel .. not_vowel .."*)$","%1" ..  mw.ustring.char(0x301) .. "%2")
             --else
+
            elseif transcriptio =='i' then
               --decomposed=mw.ustring.gsub(decomposed,"(".. vowel ..")(" .. not_vowel .. "*)$",'%1'..mw.ustring.char(0x301)..%2')
+
               decomposed = mw.ustring.gsub(decomposed,"(" .. vowel .. ")(" .. not_vowel .. "*" .. vowel .. not_vowel .."*)$","%1" ..  mw.ustring.char(0x301) .. "%2")
    end
+
            else
end
+
              
 +
               decomposed=mw.ustring.gsub(decomposed,"(".. vowel ..")(" .. not_vowel .. "*)$",'%1' ..mw.ustring.char(0x301).. '%2')
 +
       
 +
    end
 +
      end
 
 
 
local transcription = decomposed
 
local transcription = decomposed
Riga 277: Riga 286:  
"([kg])(" .. front .. ")",
 
"([kg])(" .. front .. ")",
 
"%1" .. fronted .. "%2")
 
"%1" .. fronted .. "%2")
:gsub("a", "ä")
+
:gsub("a", "a")
 
:gsub("n", "n̺") -- Converts n before a consonant, which is incorrect.
 
:gsub("n", "n̺") -- Converts n before a consonant, which is incorrect.
 
 

Menu di navigazione