Module:Hindi frequency list

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

Generates the table at Wiktionary:Frequency lists/Hindi 1900.


local export = {}
	
local header = [[
{| class="wikitable sortable"
|-
! SN !! Frequency !! Word !! Transliteration
]]
local footer = ]

local unpack = unpack or table.unpack -- Lua 5.2 compatibility

local lang = require "Module:languages".getByCode("hi")
local function link_and_transliterate(word, lang_code, lang_name, script)
	local translit = (lang:transliterate(word))
	return '<span class="' .. script .. '" lang="' .. lang_code .. '">[['
		.. word .. '#' .. lang_name .. '|' .. word .. ']]</span>',
		'<span class="tr Latn" lang="' .. lang_code .. '-Latn">' .. translit .. '</span>'
end

function export.list(frame)
	local args = require "Module:table".shallowCopy(frame.args)
	local arg_group_size = 2
	if #args % arg_group_size ~= 0 then
		error(("The number of arguments should be a multiple of %d, but is %d")
			:format(arg_group_size, #args))
	end
	
	local Array = require "Module:array"
	local output = Array()
	output:insert(header)
	local i = 0
	local trim = mw.text.trim
	for arg_i = 1, #args, arg_group_size do
		i = i + 1
		local frequency, hindi = unpack(args, arg_i, arg_i + arg_group_size - 1)
		frequency, hindi = trim(frequency), trim(hindi)
		local link, translit = link_and_transliterate(hindi, "Hindi", "hi", "Deva")
		output:insert(("|-\n| %s || %s || %s || %s\n"):format(
			i,
			frequency,
			link,
			translit))
	end
	output:insert(footer)
	return output:concat()
end

return export