Module:User:Sitaron/Khmer frequency list

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


local export = {}

local header = [[
{| class="wikitable sortable" style="text-align:center; background-color:#fdfdfd" 
|-
! Rank !! Word !! Count !! Freq (ppm) !! Cumul (%) !! Additional information
]]
local footer = ]

local function link(word, lang_code, lang_name, script)
	return '<span class="' .. script .. '" lang="' .. lang_code .. '">[['
		.. word .. '#' .. lang_name .. '|' .. word .. ']]</span>'
end

function export.list(frame)
	local args = require "Module:table".shallowcopy(frame.args)
	if #args % 3 ~= 0 then
		error(("The number of arguments should be a multiple of 3, but is %d")
			:format(#args))
	end
	
	local init_rank, init_count, total_count = unpack(args, 1, 3)
	
	local Array = require "Module:array"
	local output = Array()
	output:insert(header)
	
	local rank = init_rank
	local cumul_count = init_count
	for i = 4, #args, 3 do
		local word, count, details= unpack(args, i, i + 3)

		cumul_count = cumul_count +count

		freq = math.floor(count / total_count * 100000000)/100
		cumul = math.floor(cumul_count / total_count * 10000)/100
		
		output:insert(("|-style='vertical-align:top'\n|%s|| style='text-align: left' |%s||%s||%s||%s||style='text-align: left' |%s\n"):format(
			rank, word, count, freq, cumul, details))
		--output:insert(("|-style='vertical-align:top'\n|%s||%s||%s||%s||%s||%s\n"):format(
		--	rank, word, count, freq, cumul, details))


	    rank = rank +1
	end
	output:insert(footer)
	return output:concat()
end


function export.list2(frame)
	local args = require "Module:table".shallowcopy(frame.args)
	if #args % 6 ~= 0 then
		error(("The number of arguments should be a multiple of 6, but is %d")
			:format(#args))
	end

	local Array = require "Module:array"
	local output = Array()
	output:insert(header)
	
	local rank = init_rank
	local cumul_count = init_count
	for i = 1, #args, 6 do
		local rank, word, count, freq, cumul, details= unpack(args, i, i + 5)
		
		output:insert(("|-\n| %s || %s || %s || %s || %s || %s\n"):format(
			rank, word, count, freq, cumul, details))
	end
	output:insert(footer)
	return output:concat()
end




return export