From Wikipedia, the free encyclopedia

p = {}

-- Join two tables.

-- Number index are added over the first table.

-- Other type of keys are added "as they are".

function p.join_tables(_table1, _table2)

	for k, arg in pairs(_table2) do

		if not tonumber(k) then

			_table1k = arg

		else

			table.insert(_table1, arg)

		end

	end

	return _table1

end



-- Converts table data type to String.

-- Keys should be int numbers.

-- Values are concatenated with ", "

function p.table2string(_table)

	original_table = _table

	wrapped = ""

	for i=1, #original_table do

		wrapped = wrapped .. original_tablei .. ", "

	end

	return wrapped:sub(0, -3)

end

	

function p.get_rows(frame)

	return p._get_rows(frame.args)

end



function p.string2table(_string)

	-- Should work for nested values.

	_string = "test,[home,cheese],[restaurant,pc]"

	ltable = {}

	for value in _string:gmatch("%[(%[^%[%a+%])%]") do

		if string:find(value, "[^%[]") then

			ntable = {}

			for column in value:gmatch("[^,]+") do

				table.insert(ntable, column)

			end

			table.insert(ltable, ntable)

		else

		end

	end

	return mw.logObject(ltable)

end





function p._get_rows(args)

	local page = args.src or args1

	local data = mw.ext.data.get(page)

	local columns_input = args.columns or args2

	local columns_table = p.string2table(column_input)

	-- local column_names = args.column_names or args[2]

	-- local column_groups = args.column_groups or args[3]

	-- Also optional title for rows should be included.

	local date_name = args.date_name or args3

	rows = {}

	rows.titles = {}

	rows.values = {}

end



return p
From Wikipedia, the free encyclopedia

p = {}

-- Join two tables.

-- Number index are added over the first table.

-- Other type of keys are added "as they are".

function p.join_tables(_table1, _table2)

	for k, arg in pairs(_table2) do

		if not tonumber(k) then

			_table1k = arg

		else

			table.insert(_table1, arg)

		end

	end

	return _table1

end



-- Converts table data type to String.

-- Keys should be int numbers.

-- Values are concatenated with ", "

function p.table2string(_table)

	original_table = _table

	wrapped = ""

	for i=1, #original_table do

		wrapped = wrapped .. original_tablei .. ", "

	end

	return wrapped:sub(0, -3)

end

	

function p.get_rows(frame)

	return p._get_rows(frame.args)

end



function p.string2table(_string)

	-- Should work for nested values.

	_string = "test,[home,cheese],[restaurant,pc]"

	ltable = {}

	for value in _string:gmatch("%[(%[^%[%a+%])%]") do

		if string:find(value, "[^%[]") then

			ntable = {}

			for column in value:gmatch("[^,]+") do

				table.insert(ntable, column)

			end

			table.insert(ltable, ntable)

		else

		end

	end

	return mw.logObject(ltable)

end





function p._get_rows(args)

	local page = args.src or args1

	local data = mw.ext.data.get(page)

	local columns_input = args.columns or args2

	local columns_table = p.string2table(column_input)

	-- local column_names = args.column_names or args[2]

	-- local column_groups = args.column_groups or args[3]

	-- Also optional title for rows should be included.

	local date_name = args.date_name or args3

	rows = {}

	rows.titles = {}

	rows.values = {}

end



return p

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook