<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AMake_emoji_zwj_table</id>
	<title>Module:Make emoji zwj table - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AMake_emoji_zwj_table"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Make_emoji_zwj_table&amp;action=history"/>
	<updated>2026-05-27T10:36:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Make_emoji_zwj_table&amp;diff=143922&amp;oldid=prev</id>
		<title>imported&gt;Trappist the monk at 15:06, 13 November 2022</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Make_emoji_zwj_table&amp;diff=143922&amp;oldid=prev"/>
		<updated>2022-11-13T15:06:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
&lt;br /&gt;
This module creates an associative table emoji code points that may follow a zero-width joiner character (U+200D).&lt;br /&gt;
&lt;br /&gt;
The module reads a copy of the Unicode Emoji ZWJ Sequences for UTS (typically emoji-zwj-sequences.txt found in&lt;br /&gt;
https://unicode.org/Public/emoji/VV.V/ where VV.V is the Unicode version number).  The copy of the unicode data&lt;br /&gt;
file is held inside html comments in the module&amp;#039;s /doc page.  From that file, the module extracts pairs of&lt;br /&gt;
&amp;lt;zwj&amp;gt; &amp;lt;emoji code point&amp;gt;. The moculde save each unique code point, transformed as necessary to build a new version&lt;br /&gt;
of emoji_t for use in Module:Citation/CS1/Configuration.&lt;br /&gt;
&lt;br /&gt;
The module takes one positional parameter:&lt;br /&gt;
	{{#invoke:make emoji zwj table|main|&amp;lt;url&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;url&amp;gt; is the url that matches the Unicode data file.  Alas, Lua modules cannot read external data files so &amp;lt;url&amp;gt;&lt;br /&gt;
is merely used to document where the data may be found.&lt;br /&gt;
&lt;br /&gt;
Use of this module is documented on its /doc page&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
require(&amp;#039;strict&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
local emoji_names_t = {															-- keys are hex values from U+xxxx code points&lt;br /&gt;
	[&amp;#039;2620&amp;#039;] = &amp;#039;skull and crossbones&amp;#039;,&lt;br /&gt;
	[&amp;#039;2640&amp;#039;] = &amp;#039;female sign&amp;#039;,&lt;br /&gt;
	[&amp;#039;2642&amp;#039;] = &amp;#039;male sign&amp;#039;,&lt;br /&gt;
	[&amp;#039;2695&amp;#039;] = &amp;#039;staff of aesculapius&amp;#039;,&lt;br /&gt;
	[&amp;#039;2696&amp;#039;] = &amp;#039;scales&amp;#039;,&lt;br /&gt;
	[&amp;#039;26A7&amp;#039;] = &amp;#039;male with stroke and male and female sign&amp;#039;,&lt;br /&gt;
	[&amp;#039;2708&amp;#039;] = &amp;#039;airplane&amp;#039;,&lt;br /&gt;
	[&amp;#039;2744&amp;#039;] = &amp;#039;snowflake&amp;#039;,&lt;br /&gt;
	[&amp;#039;2764&amp;#039;] = &amp;#039;heavy black heart&amp;#039;,&lt;br /&gt;
	[&amp;#039;2B1B&amp;#039;] = &amp;#039;black large square&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F308&amp;#039;] = &amp;#039;rainbow&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F32B&amp;#039;] = &amp;#039;fog&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F33E&amp;#039;] = &amp;#039;ear of rice&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F373&amp;#039;] = &amp;#039;cooking&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F37C&amp;#039;] = &amp;#039;baby bottle&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F384&amp;#039;] = &amp;#039;christmas tree&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F393&amp;#039;] = &amp;#039;graduation cap&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F3A4&amp;#039;] = &amp;#039;microphone&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F3A8&amp;#039;] = &amp;#039;artist palette&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F3EB&amp;#039;] = &amp;#039;school&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F3ED&amp;#039;] = &amp;#039;factory&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F466&amp;#039;] = &amp;#039;boy&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F467&amp;#039;] = &amp;#039;girl&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F468&amp;#039;] = &amp;#039;man&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F469&amp;#039;] = &amp;#039;woman&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F48B&amp;#039;] = &amp;#039;kiss mark&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F4A8&amp;#039;] = &amp;#039;dash symbol&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F4AB&amp;#039;] = &amp;#039;dizzy symbol&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F4BB&amp;#039;] = &amp;#039;personal computer&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F4BC&amp;#039;] = &amp;#039;brief case&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F525&amp;#039;] = &amp;#039;fire&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F527&amp;#039;] = &amp;#039;wrench&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F52C&amp;#039;] = &amp;#039;microscope&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F5E8&amp;#039;] = &amp;#039;left speech bubble&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F680&amp;#039;] = &amp;#039;rocket&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F692&amp;#039;] = &amp;#039;fire engine&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F91D&amp;#039;] = &amp;#039;handshake&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9AF&amp;#039;] = &amp;#039;probing cane&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9B0&amp;#039;] = &amp;#039;emoji component red hair&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9B1&amp;#039;] = &amp;#039;emoji component curly hair&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9B2&amp;#039;] = &amp;#039;emoji component bald&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9B3&amp;#039;] = &amp;#039;emoji component white hair&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9BA&amp;#039;] = &amp;#039;safety vest&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9BC&amp;#039;] = &amp;#039;motorized wheelchair&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9BD&amp;#039;] = &amp;#039;manual wheelchair&amp;#039;,&lt;br /&gt;
	[&amp;#039;1F9D1&amp;#039;] = &amp;#039;adult&amp;#039;,&lt;br /&gt;
	[&amp;#039;1FA79&amp;#039;] = &amp;#039;adhesive bandage&amp;#039;,&lt;br /&gt;
	[&amp;#039;1FAF2&amp;#039;] = &amp;#039;leftwards hand&amp;#039;,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M A I N &amp;gt;----------------------------------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function main (frame)&lt;br /&gt;
	local this_wiki = table.concat ({&amp;#039;:&amp;#039;, mw.language.getContentLanguage():getCode(), &amp;#039;:&amp;#039;});&lt;br /&gt;
	local title_obj = mw.title.getCurrentTitle();&lt;br /&gt;
	local content;&lt;br /&gt;
	if title_obj.prefixedText:match (&amp;#039;/doc$&amp;#039;) then								-- if this title object is the ~/doc page (viewing the ~/doc page standalone)&lt;br /&gt;
		content = title_obj:getContent();										-- get the content&lt;br /&gt;
	else																		-- when viewing the module page&lt;br /&gt;
		content = mw.title.new (table.concat ({title_obj.prefixedText, &amp;#039;/doc&amp;#039;})):getContent();	-- get title object and content for the ~/doc page&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local code_points_t = {};													-- sequence to hold unique code points that follow U+200D in RGI Emoji ZWJ Sequences in decimal&lt;br /&gt;
	local out_t = {};															-- final output goes here&lt;br /&gt;
	local new_emoji_names_t = {};												-- used to update emoji_names_t in this module&lt;br /&gt;
	local tabs_15 = string.rep (&amp;#039;\t&amp;#039;, 15);										-- for six-digit keys&lt;br /&gt;
	local tabs_16 = string.rep (&amp;#039;\t&amp;#039;, 16);										-- for keys that have fewer than six digits&lt;br /&gt;
	local file_date = content:match (&amp;#039;# *Date: *(%d%d%d%d%-%d%d%-%d%d)&amp;#039;);		-- file date of the Unicode source&lt;br /&gt;
	local file_version = content:match (&amp;#039;# *Version: *([%d%.]+)&amp;#039;);				-- version of the Unicode source&lt;br /&gt;
&lt;br /&gt;
	for code_point in content:gmatch (&amp;#039;200D (%x+)&amp;#039;) do							-- find each &amp;lt;zwj&amp;gt; &amp;lt;code point&amp;gt; pair&lt;br /&gt;
		local code_point_dec = tonumber (&amp;#039;0x&amp;#039; .. code_point);					-- convert hex code point to decimal for output table key&lt;br /&gt;
&lt;br /&gt;
		if not code_points_t[code_point] then									-- if we have not seen this &amp;lt;code_point&amp;gt; before&lt;br /&gt;
			code_points_t[code_point] = true;									-- remember that we have now seen this &amp;lt;code_point&amp;gt;&lt;br /&gt;
			table.insert (out_t, table.concat ({								-- build a line for this code point&lt;br /&gt;
				&amp;#039;\t[&amp;#039;,															-- open key markup&lt;br /&gt;
				code_point_dec,													-- &amp;lt;code_point&amp;gt; in decimal&lt;br /&gt;
				&amp;#039;] = true,&amp;#039;,													-- close key and assign it the value &amp;#039;true&amp;#039;&lt;br /&gt;
				(100000 &amp;lt;= code_point_dec) and tabs_15 or tabs_16,				-- insert a bunch of tabs between the k/v pair and an associated comment&lt;br /&gt;
				&amp;#039;-- U+&amp;#039;,														-- start the comment; prefix for the hex &amp;lt;code point&amp;gt;&lt;br /&gt;
				code_point,														-- add the &amp;lt;code point&amp;gt;&lt;br /&gt;
				&amp;#039; &amp;amp;#x&amp;#039;,															-- hex html entity prefix for &amp;lt;code point&amp;gt;&lt;br /&gt;
				code_point,														-- add the &amp;lt;code point&amp;gt;&lt;br /&gt;
				&amp;#039;; &amp;#039;,															-- finish the html entity&lt;br /&gt;
				emoji_names_t[code_point] and emoji_names_t[code_point] or &amp;#039;&amp;#039;,	-- if we have a name for this code point, add the name; empty string else&lt;br /&gt;
				}));&lt;br /&gt;
&lt;br /&gt;
			table.insert (new_emoji_names_t, table.concat ({					-- build a line for this code point&lt;br /&gt;
				&amp;#039;\t[\&amp;#039;&amp;#039;,															-- open key markup&lt;br /&gt;
				code_point,														-- &amp;lt;code_point&amp;gt; in hex&lt;br /&gt;
				&amp;#039;\&amp;#039;] = \&amp;#039;&amp;#039;,														-- close key, open quote mark and ready to assign it a name&lt;br /&gt;
				emoji_names_t[code_point] and emoji_names_t[code_point] or &amp;#039;&amp;#039;,	-- if we have a name for this code point, add the name; empty string else&lt;br /&gt;
				&amp;#039;\&amp;#039;,&amp;#039;,															-- add closing quote mark and terminal comma&lt;br /&gt;
				}));&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function compare_dec (a, b)											-- local compare function for decimal table.sort() ascending&lt;br /&gt;
		a = a:match (&amp;#039;%[(%d+)%]&amp;#039;);												-- extract decimal key text&lt;br /&gt;
		b = b:match (&amp;#039;%[(%d+)%]&amp;#039;);&lt;br /&gt;
		return tonumber (a) &amp;lt; tonumber (b);										-- convert key text to numbers and compare&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function compare_hex (a, b)											-- local compare function for hexadecimal table.sort() ascending&lt;br /&gt;
		a = a:match (&amp;#039;%[\&amp;#039;(%x+)\&amp;#039;%]&amp;#039;);											-- extract hexadecimal key text&lt;br /&gt;
		b = b:match (&amp;#039;%[\&amp;#039;(%x+)\&amp;#039;%]&amp;#039;);&lt;br /&gt;
		a = table.concat ({&amp;#039;0x&amp;#039;, a});											-- make a hex string&lt;br /&gt;
		b = table.concat ({&amp;#039;0x&amp;#039;, b});&lt;br /&gt;
		return tonumber (a) &amp;lt; tonumber (b);										-- convert hex key text todecimal numbers and compare&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	table.sort (out_t, compare_dec);											-- ascending numerical sort on decimal keys&lt;br /&gt;
	&lt;br /&gt;
	local prefix_t = {};														-- build a prefix for this version of the table&lt;br /&gt;
	table.insert (prefix_t, &amp;#039;==&amp;lt;span style=&amp;quot;font-family: monospace, monospace;&amp;quot;&amp;gt;emoji_t&amp;lt;/span&amp;gt;==&amp;#039;);&lt;br /&gt;
	table.insert (prefix_t, &amp;#039;use this table to overwrite same-named table in [[Module:Citation/CS1/Configuration/sandbox]]&amp;#039;);&lt;br /&gt;
	table.insert (prefix_t, &amp;#039;&amp;lt;pre&amp;gt;-- list of emoji that use a zwj character (U+200D) to combine with another emoji&amp;#039;);&lt;br /&gt;
	table.insert (prefix_t, table.concat ({&amp;#039;-- from: &amp;#039;, frame.args[1], &amp;#039;; version: &amp;#039;, file_version, &amp;#039;; &amp;#039;, file_date}));&lt;br /&gt;
	table.insert (prefix_t, table.concat ({&amp;#039;-- table created by: [[&amp;#039;, this_wiki, title_obj.nsText, &amp;#039;:&amp;#039;, title_obj.baseText, &amp;#039;]]&amp;#039;}));&lt;br /&gt;
	table.insert (prefix_t, table.concat ({&amp;#039;local emoji_t = {&amp;#039;, tabs_16, &amp;#039;-- indexes are decimal forms of the hex values in U+xxxx&amp;#039;}));&lt;br /&gt;
&lt;br /&gt;
	table.insert (out_t, 1, table.concat (prefix_t, &amp;#039;\n&amp;#039;));						-- insert at the head of the output table&lt;br /&gt;
	table.insert (out_t, &amp;#039;\t}&amp;lt;/pre&amp;gt;&amp;#039;);											-- close the &amp;lt;pre&amp;gt; tag&lt;br /&gt;
&lt;br /&gt;
	table.sort (new_emoji_names_t, compare_hex);								-- ascending numerical sort on hexadecimal keys&lt;br /&gt;
&lt;br /&gt;
	table.insert (out_t, &amp;#039;==&amp;lt;span style=&amp;quot;font-family: monospace, monospace;&amp;quot;&amp;gt;emoji_names_t&amp;lt;/span&amp;gt;==&amp;#039;);&lt;br /&gt;
	table.insert (out_t, table.concat ({&amp;#039;use this table to overwrite same-named table in &amp;#039;, this_wiki, title_obj.nsText, &amp;#039;:&amp;#039;, title_obj.baseText, &amp;#039;; add missing names.&amp;#039;}));&lt;br /&gt;
	table.insert (out_t, table.concat ({&amp;#039;\n&amp;lt;pre&amp;gt;local emoji_names_t = {&amp;#039;, tabs_15, &amp;#039;-- keys are hex values from U+xxxx code points&amp;#039;}));&lt;br /&gt;
	for _, v in ipairs (new_emoji_names_t)do&lt;br /&gt;
		table.insert (out_t, v);&lt;br /&gt;
	end&lt;br /&gt;
	table.insert (out_t, &amp;#039;\t}&amp;lt;/pre&amp;gt;&amp;#039;);											-- close the &amp;lt;pre&amp;gt; tag&lt;br /&gt;
&lt;br /&gt;
	return frame:preprocess (table.concat (out_t, &amp;#039;\n&amp;#039;));						-- make a big string and done&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T S &amp;gt;----------------------------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	main = main,&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>imported&gt;Trappist the monk</name></author>
	</entry>
</feed>