Module:User:MuDavid/vi-adj

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


local p = {}

local m_links = require("Module:links")
local m_utils = require("Module:utilities")
local lang = require("Module:languages").getByCode("vi")

local tone_diacritics = {  = "̀",  = "",  = "",  = "̀",  = "̀" }

local checked_finals = {  = "m",  = "n",  = "nh",  = "ng" }

function p.rdp_one(frame)
	local lemma = frame.args
	local rdp_syll_normed = mw.ustring.toNFD(lemma)
	rdp_syll_normed = mw.ustring.gsub(rdp_syll_normed, "̣̂", "̂̀") -- dot-below is put before circumflex, which causes problems later on
	rdp_syll_normed = mw.ustring.gsub(rdp_syll_normed, "̣̆", "̆̀") -- same with breve
	for orig, modif in pairs(tone_diacritics) do
		rdp_syll_normed = mw.ustring.gsub(rdp_syll_normed, orig, modif)
	end
	for orig, modif in pairs(checked_finals) do
		rdp_syll_normed = mw.ustring.gsub(rdp_syll_normed, orig, modif)
	end
	return mw.ustring.toNFC(rdp_syll_normed) .. " " .. lemma
end

local function a_rdp(syllable)
	local syllable_normed = mw.ustring.toNFD(syllable)
	local a_with_tone = "a"
	if mw.ustring.find(syllable_normed, "") ~= nil then
		a_with_tone = "à"
	end
	local initial = mw.ustring.match(syllable_normed, "(+)")
	return mw.ustring.toNFC(initial .. a_with_tone)
end

function p.rdp_two(frame)
	local lemma = frame.args
	local syllables = {}
	for w in string.gmatch(lemma, "(+)") do
		table.insert(syllables, w)
	end
	return syllables .. " " .. a_rdp(syllables) .. " " .. lemma
end

function p.rdp_two_var(frame)
	local lemma = frame.args
	local syllables = {}
	for w in string.gmatch(lemma, "(+)") do
		table.insert(syllables, w)
	end
	return lemma .. " " .. a_rdp(syllables) .. " " .. a_rdp(syllables)
end

function p.rdp_type(frame)
	local type_of_rdp = { = "dim",  = "aug"}
	local lemma = frame.args
	local s, number_of_spaces = string.gsub(lemma," "," ")
	return type_of_rdp
end

return p