Module:User:BajookThug/test-pa-hyph

Hello, you have come here looking for the meaning of the word Module:User:BajookThug/test-pa-hyph. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:BajookThug/test-pa-hyph, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:BajookThug/test-pa-hyph in singular and plural. Everything you need to know about the word Module:User:BajookThug/test-pa-hyph you have here. The definition of the word Module:User:BajookThug/test-pa-hyph will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:BajookThug/test-pa-hyph, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local p = {}

function p.main(frame)
    local word = mw.text.trim(frame.args or '')
    if word == '' then return end
    
    -- Normalize to composed form (NFC) for consistent processing
    word = mw.ustring.toNFC(word)
    
    -- Define Gurmukhi combining characters (vowel signs, diacritics)
    local combining = {
         = true, -- Nukta (਼)
         = true, -- Vowel sign aa (ਾ)
         = true, -- Vowel sign i (ਿ)
         = true, -- Vowel sign ii (ੀ)
         = true, -- Vowel sign u (ੁ)
         = true, -- Vowel sign uu (ੂ)
         = true, -- Vowel sign ee (ੇ)
         = true, -- Vowel sign ai (ੈ)
         = true, -- Vowel sign oo (ੋ)
         = true, -- Vowel sign au (ੌ)
         = true, -- Virama (੍)
         = true, -- Adak bindi (ਁ)
         = true, -- Bindi (ਂ)
         = true, -- Visarga (ਃ)
         = true, -- Tippi (ੰ)
         = true, -- Addak (ੱ)
    }
    
    -- Split into syllables using character positions
    local syllables = {}
    local current = ''
    local len = mw.ustring.len(word)
    
    for i = 1, len do
        local char = mw.ustring.sub(word, i, i)
        local cp = mw.ustring.codepoint(char)
        
        if combining then
            current = current .. char
        else
            if current ~= '' then
                table.insert(syllables, current)
            end
            current = char
        end
    end
    
    if current ~= '' then
        table.insert(syllables, current)
    end
    
    -- Generate {{hyph|pa|...}} structure
    local parts = table.concat(syllables, '|')
    return mw.getCurrentFrame():expandTemplate{
        title = 'hyph',
        args = { 'pa', parts }
    }
end

return p