Module:accel/eo

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

This module contains new entry creation rules for Esperanto; see WT:ACCEL for an overview, and Module:accel for information on creating new rules.


return {generate = function (params, entry)
	local index = params.origin:find(" de ")
	-- Get word before " de "
	local usub = mw.ustring.sub
	local word = index and params.origin:sub(1, index - 1) or params.origin
	local stem = usub(word, 1, -2)
	local ending = usub(word, -1)
	
	if ending == "j" then
		stem = "original=" .. params.origin .. "|"
		ending = usub(word, -2, -2)
	end
	
	if index then
		stem = "original=" .. params.origin .. "|"
	end
	
	if not ("aio"):find(ending) then
		return error("The Esperanto word \"" .. params.origin .. "\" does not end in -o or -a or -i or -oj or -aj (index = " .. index .. ", word = " .. word .. ", stem = " .. stem .. ", ending = " .. ending .. ").")
	end

	if ending == "i" then
		ending = ""
	end
	
	local formparam = {
		   = "n|unc=yes",
		     = "j" .. (params.pos == "proper noun" and "-proper" or ""),
		 = "n" .. (params.pos == "proper noun" and "-properpl" or ""),
		 = "jn" .. (params.pos == "proper noun" and "-properpl" or ""),
		  = "as",
		  = "is",
		  = "os",
		  = "us",
		  = "u",
	}
	
	local inflection = formparam or params.form
	
	if params.pos ~= "proper noun" then
		entry.head = "{{eo-head}}"
	end
	
	local participle_ending = inflection:match("n?t(j?n?)$")
	if participle_ending then
		-- Two or three letters long.
		-- Alternative: participle_ending:match("(j?n?)$") ~= ""
		if #participle_ending >= 2 then
			entry.head = "{{eo-part}}"
		else -- One letter long.
			if participle_ending == "a" then
				entry.pos_header = "Adjective"
			elseif participle_ending == "e" then
				entry.pos_header = "Adverb"
			elseif participle_ending == "o" then
				entry.pos_header = "Noun"
			end
		end
	end
	
	entry.def = "{{eo-form of|" .. stem .. "|" .. ending .. inflection .. "}}"
end}