모듈:연습장/Drhyme/모듈3

--labeln= parameter value for 
TODO: convert showflag to a comma delimited list instead of these peculiar codes?

local label_map = {
	'bp' = '민난화 병음',
	'bpmf' = '주음부호',
	'gan' = '간어',
	'gd' = '광둥어 병음',
	'h' = '하카화 병음',
	'hsn' = '샹어',
	'j' = '월어 병음',
	'lmz' = '상하이어 로마자',
	'p' = '병음',
	'phfs' = '백화자',
	'poj' = '민난어 백화자',
	'psic' = '쓰촨어 병음',
	'tl' = '타이로 병음',
	'toi' = '타이산화',
	'tp' = '통용 병음',
	'w' = '웨이드–자일스 표기법',
	'wuu' = '우어',
	'xej' = '샤오얼징',
	'y' = '광둥어 예일 로마자',
	}
--showflag= are in dispute see: Template_talk:Infobox_Chinese#Rfc_on_fixing_the_template_showflag
linked conversation is at: Template_talk:Infobox_Chinese/Archive_4#Showflag broken
local transl_map = {															-- maps |showflag= value to label from label_map table and data from matching parameter name
	'bp' = {'label1' = 'bp', 'data1' = 'bp'},
	'bpmf' = {'label1' = 'bpmf', 'data1' = 'bpmf'},
	'gan' = {'label1' = 'gan', 'data1' = 'gan'},
	'gdp' = {'label1' = 'gd', 'data1' = 'gd', 'label2' = 'p', 'data2' = 'p'},
	'h' = {'label1' = 'h', 'data1' = 'h'},
	'hsn' = {'label1' = 'hsn', 'data1' = 'hsn'},
	'j' = {'label1' = 'j', 'data1' = 'j'},
	'jp' = {'label1' = 'j', 'data1' = 'j', 'label2' = 'p', 'data2' = 'p'},
	'jy' = {'label1' = 'j', 'data1' = 'j', 'label2' = 'y', 'data2' = 'y'},
	'jyp' = {'label1' = 'j', 'data1' = 'j', 'label2' = 'y', 'data2' = 'y', 'label3' = 'p', 'data3' = 'p'},
	'lmz' = {'label1' = 'lmz', 'data1' = 'lmz'},
	'p' = {'label1' = 'p', 'data1' = 'p'},
	'phfs' = {'label1' = 'phfs', 'data1' = 'phfs'},
	'phsn' = {'label1' = 'p', 'data1' = 'p', 'label2' = 'hsn', 'data2' = 'hsn'},
	'pj' = {'label1' = 'p', 'data1' = 'p', 'label2' = 'j', 'data2' = 'j'},
	'poj' = {'label1' = 'poj', 'data1' = 'poj'},
	'psic' = {'label1' = 'p', 'data1' = 'p', 'label2' = 'sic', 'data2' = 'sic'},
	'pwuu' = {'label1' = 'p', 'data1' = 'p', 'label2' = 'wuu', 'data2' = 'wuu'},
	'py' = {'label1' = 'p', 'data1' = 'p', 'label2' = 'y', 'data2' = 'y'},
	'tl' = {'label1' = 'tl', 'data1' = 'tl'},
	'toip' = {'label1' = 'toi', 'data1' = 'toi', 'label2' = 'p', 'data2' = 'p'},
	'tp' = {'label1' = 'tp', 'data1' = 'tp'},
	'wp' = {'label1' = 'w', 'data1' = 'w', 'label2' = 'p', 'data2' = 'p'},
	'wuu' = {'label1' = 'wuu', 'data1' = 'wuu'},
	'y' = {'label1' = 'y', 'data1' = 'y'},
	'yj' = {'label1' = 'y', 'data1' = 'y', 'label2' = 'j', 'data2' = 'j'},
	'xej' = {
		'label1' = 'xej',
		'data1' = 'xej',				-- ???? what to do about this; template calls  on this value
		},
	'xejp' = {
		'label1' = 'xej',
		'data1' = 'xej',				-- ???? template does not call  on this value; why?
		'label2' = 'p',
		'data2' = 'p'
		},
	}
--------------------------------------------------------------------------------------------------
local keys = {																	-- table of xscript table keys calls
	ar = 'arabic',
	bo = 'tibetan',
	hokkien = 'hokkien',
	ja = 'japanese',
	ko = 'korean',
	mn = 'mongolian',
	ru = 'russian',
	ug = 'uyghur',
	}
--------------------------------------------------------------------------------------------
table that holds the various transcription headers and labels used by transcriptions()
indexed in this table are lower case versions of the header display text without punctuation (if any)
TODO: add support for transl transliteration standard parameter; akin to italic=??
local xscript = {
	'standard mandarin' = {													-- lower case version of the header display text
		'header' = '보통화',					-- text to be displayed if headers are displayed
		't' = {																-- table of labels and their associated data parameter
			{'한어 병음', 'p'},											-- label is Hanyu Pinyin, data is taken from |p= parameter
			{'주음부호','bpmf'},
			{'국어라마자', 'gr'},
			{'웨이드-자일스 표기법', 'w'},
			{'통용 병음', 'tp'},
			{'예일 로마자 표기법', 'myr'},
			{'주음부호 로마자', 'mps'},
			{'IPA', 'mi'}
			}
		},
	'other mandarin' = {
		'header' = '그 외 보통화',
		't' = {
			{'샤오얼징', 'xej'},
			{'둥간어','zh-dungan'},
			{'쓰촨어 병음', 'sic'},
			}
		},
	'wu' = {
		'header' = '우어',
		't' = {
			{'우어 로마자', 'wuu'},
			{'상하이어 로마자', 'lmz'},
			{'원저우어 로마자', 'ouji'},
			{'쑤저우어', 'suz'},
			}
		},
	'gan' = {
		'header' = '간어',
		't' = {
			{'로마자', 'gan'},
			}
		},
	'xiang' = {
		'header' = '샹어',
		't' = {
			{'IPA', 'hsn'},
			}
		},
	'hakka' = {
		'header' = '객가어',
		't' = {
			{'병음', 'h'},
			{'백화자', 'phfs'},
			}
		},
	'yue cantonese' = {
		'header' = '웨어 광둥화',
		't' = {
			{'예일 로마자', 'y'},
			{'병음', 'j'},
			{'시드니 라우 로마자', 'sl'},
			{'광둥어 병음', 'gd'},
			{'홍콩 정부 병음', 'hk'},
			{'마카오 병음', 'mo'},
			{'IPA', 'ci'},
			}
		},
	'other yue' = {
		'header' = '그 외 웨어',
		't' = {
			{'타이산어', 'toi'},
			}
		},
	'southern min' = {
		'header' = '민난어',
		't' = {
			{'호키엔 백화자', 'poj'},
			{'타이로', 'tl'},
			{'민난화 병음', 'bp'},
			{'차오저우어 병음', 'teo'},
			{'하이난어 로마자', 'hain'},
			{'레이저우 로마자', 'lizu'},
			}
		},
	'eastern min' = {
		'header' = '민둥어',
		't' = {
			{'푸저우화 평화자', 'buc'},
			}
		},
	'pu-xian min' = {
		'header' = '푸셴어',
		't' = {
			{'푸셴어 평화자', 'hhbuc'},
			}
		},
	'northern min' = {
		'header' = '민베이어',
		't' = {
			{'젠닝화 로마자', 'mblmc'},
			}
		},
	'old mandarin' = {
		'header' = '고관화',
		't' = {
			{'Romanized \'Phags-pa', 'phagspa-latin'},
			}
		},
	'middle chinese' = {
		'header' = 'Middle Chinese',
		't' = {
			{'Middle Chinese', 'mc'},
			{'Early Middle Chinese', 'emc'},
			{'Late Middle Chinese', 'lmc'},
			}
		},
	'old chinese' = {
		'header' = 'Old Chinese',
		't' = {
			{'Baxter (1992)', 'oc-b92'},
			{'Baxter–Sagart (2014)', 'oc-bs'},
			{'Zhengzhang', 'oc-zz'},
			}
		},
----------------
	'arabic' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'Chat', 'chat'},							-- TODO: standardize on lowercase parameter names
			{'Chat', 'Chat'},
			{'ALA-LC', 'ala-lc'},
			{'ALA-LC', 'ALA-LC'},
			{'ISO', 'iso'},
			{'ISO', 'ISO'},
			{'DIN', 'din'},
			{'DIN', 'DIN'},
			}
		},
	'hokkien' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'Tâi-lô', 'tl'},
			{'Bbánpìng', 'bp'},
			{'IPA', 'hokkienipa'},
			}
		},
	'japanese' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'로마자', 'romaji'},
			{'헵번식 로마자', 'revhep'},
			{'헵번식 로마자 (舊)', 'tradhep'},
			{'훈령식 로마자', 'kunrei'},
			{'일본식 로마자', 'nihon'},
			}
		},
	'korean' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'로마자', 'rr'},
			{'매큔-라이샤워', 'mr'},
			{'IPA', 'koreanipa'},
			}
		},
	'mongolian' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'SASM/GNC', 'monr'},
			}
		},
	'russian' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'Scientific', 'scientific'},
			{'Scientific', 'Scientific'},
			{'ISO', 'iso'},
			{'ISO', 'ISO'},
			{'GOST 71', 'gost'},
			{'GOST 71', 'GOST'},
			{'BGN/PCGN', 'bgn/pcgn'},
			{'BGN/PCGN', 'BGN/PGCN'},
			}
		},
	'tibetan' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'Wylie', 'wylie'},
			{'THL', 'thdl'},
			{'Tibetan Pinyin', 'zwpy'},
			{'Lhasa IPA', 'lhasa'},
			}
		},
	'uyghur' = {
		'header' = nil,														-- ; doesn't use header
		't' = {
			{'Latin Yëziqi', 'uly'},
			{'Yengi Yeziⱪ', 'uyy'},
			{'SASM/GNC', 'sgs'},
			{'Siril Yëziqi', 'usy'},
			{'Uyghur IPA', 'uipa'},
			}
		},
	}
----------------------------------------------------------------
local ibox_zhzh_enum_params = {													-- 'p', 'hp', 'xej' are special case enum parameters
	'c', 't', 's', 'l', 'tp', 'w', 'mi', 'myr', 'psp', 'myale', 'gr', 'bpmf', 'mps',
	'zh-dungan', 'sic', 'y', 'j', 'sl', 'gd', 'hk', 'mo', 'ci', 'toi', 'gan', 'wuu', 'ouji', 'suz',
	'hsn', 'h', 'phfs', 'poj', 'tl', 'bp', 'buc', 'hhbuc', 'mblmc', 'lmz', 'teo', 'lizu', 'hain',
	'mc', 'emc', 'lmc', 'oc-bs', 'oc-zz',
	'oc-b92', 																	-- only supported in the first ibox zhzh; why?
	'lao', 'khm', 'tet'															-- not supported by ibox zh/zh  why are they here?
	}
--chinese_header2= ... like all
of the other enumerated parameters
local zh_hdr_names = {
	2 = {'altname', 'Alternative Chinese name'},
	3 = {'altname3', 'Second alternative Chinese name'},
	4 = {'altname4', 'Third alternative Chinese name'},
	5 = {'altname5', 'Fourth alternative Chinese name'},
	6 = {'altname6', 'Fifth alternative Chinese name'},
	};
----------------------------------------------------------------------------
return {
	ibox_zhzh_enum_params = ibox_zhzh_enum_params,
	keys = keys,
	label_map = label_map,
	transl_map = transl_map,
	xscript = xscript,
	zh_hdr_names = zh_hdr_names,
	}