模組:用戶:Cedric tsan cantonais/沙盒/詞性/分類/data

嚟自維基辭典
跳去導覽 跳去搵嘢
-- 爾個模組係用來產生詞性分類嘅。
local export = {}
local replace = mw.ustring.gsub
local match = mw.ustring.match

--詞性全稱,用於分類
-- 源碼:text[''] = { nom = '' }
function export.input_to_fullName(frame) 
	local text = type(frame) == 'table' and frame.args[1] or frame
		text = replace(text , '?' , '詞性未明成份')
		text = replace(text , '?' , '詞性未明成份')
		text = replace(text, 'compli', '補語化成份標誌') ---補語化成份標誌
		text = replace(text, '補成', '補語化成份標誌')
		text = replace(text , '代詞' , '代詞' ) -- 代詞
		text = replace(text , 'pronom' , '代詞' )
		text = replace(text , '人稱代詞' , '人稱代詞' ) --- 人稱代詞
		text = replace(text , '人代' , '人稱代詞' ) 
		text = replace(text , 'prn_per' , '人稱代詞' )
		text = replace(text , '物主代詞' , '物主代詞' ) --- 物主代詞
		text = replace(text , '物代' , '物主代詞' ) 
		text = replace(text , 'prn_pos' , '物主代詞' ) 
		text = replace(text , '名詞' , '名詞' ) -- 名詞
		text = replace(text , 'nom' , '名詞' ) --- 為免重複轉換,全部大寫
		text = replace(text , '陽名' , '陽性名詞' ) --- 陽性名詞
		text = replace(text , 'n_mas' , '陽性名詞' ) --- 唔用全稱係因為爾個模組會重複替換
		text = replace(text , '中名' , '中性名詞' ) --- 中性名詞
		text = replace(text , 'n_neu' , '中性名詞' )
		text = replace(text , '陰名' , '陰性名詞' ) --- 陰性名詞
		text = replace(text , 'n_fem' , '陰性名詞' )
		text = replace(text , '可數名' , '可數名詞' ) --- 可數名詞
		text = replace(text , 'n_count' , '可數名詞' )
		text = replace(text , '不可數名' , '不可數名詞' ) --- 不可數名詞
		text = replace(text , 'n_uncount' , '不可數名詞' )
		text = replace(text , '動詞' , '動詞' ) -- 動詞
		text = replace(text , 'verbe' , '動詞' )
		text = replace(text , '不及動' , '不及物動詞' ) --- 不及物動詞
		text = replace(text , 'v_i' , '不及物動詞' )
		text = replace(text , '及動' , '及物動詞' ) --- 及物動詞
		text = replace(text , 'v_t' , '及物動詞' )
		text = replace(text , '雙及動' , '雙及物動詞' ) --- 雙及物動詞
		text = replace(text , 'v_d' , '雙及物動詞' )
		text = replace(text , '助動' , '助動詞' ) --- 助動詞
		text = replace(text , 'v_aux' , '助動詞' )
		text = replace(text , '情態' , '情態動詞' ) --- 情態動詞
		text = replace(text , 'v_mod' , '情態動詞' )
		--[[助動詞同情態動詞之間最常見嘅區別係:
    	助動詞後面個動詞(主動詞/謂語動詞)要變成過去分詞,
    	情態動詞後面個動詞就通常係原型/不定式。
    	例1(英文): "I HAVE GONE home."  vs. "I MUST GO home."
    	例2(法文): "J'AI ACHETÉ cet ordinateur." vs. "Je DOIT ACHETER cet ordinateur." ]]--
		text = replace(text , '聯繫詞' , '聯繫詞' ) --- 聯繫詞
		text = replace(text , '繫動詞' , '聯繫詞' ) 
		text = replace(text , 'copula' , '聯繫詞' ) 
		text = replace(text , '冠詞' , '冠詞' ) -- 冠詞
		text = replace(text , 'article' , '冠詞' )
		text = replace(text , '定冠' , '定冠詞' ) --- 定冠詞
		text = replace(text , '定冠詞' , '定冠詞' ) 
		text = replace(text , 'art_def' , '定冠詞' ) 
		text = replace(text , '不定_冠' , '不定冠詞' ) --- 不定冠詞
		text = replace(text , '不定_冠詞' , '不定冠詞' ) 
		text = replace(text , 'art_indef' , '不定冠詞' ) 
		text = replace(text , '形容詞' , '形容詞' ) -- 形容詞
		text = replace(text , 'adj' , '形容詞' )
		text = replace(text , '副詞' , '副詞' ) -- 副詞
		text = replace(text , 'adv' , '副詞' )
		text = replace(text , '量詞' , '量詞' ) -- 量詞
		text = replace(text , 'class' , '量詞' )
		text = replace(text , '介詞' , '介詞' ) -- 介詞
		text = replace(text , '前介' , '前置介詞' ) --- 前置介詞
		text = replace(text , 'prep' , '前置介詞' )
		text = replace(text , '後介' , '後置介詞' ) --- 後置介詞
		text = replace(text , 'postp' , '前置介詞' )
		text = replace(text , '數詞' , '數詞' ) -- 數詞
		text = replace(text , 'num' , '數詞' )
		text = replace(text , '擬聲詞' , '擬聲詞' ) --擬聲詞
		text = replace(text , 'onomato' , '擬聲詞' )
		text = replace(text , '感嘆詞' , '感嘆詞' ) --感歎詞
		text = replace(text , '歎' , '感嘆詞' )
		text = replace(text , 'interject' , '感嘆詞' )
		text = replace(text , '疑問詞' , '疑問詞') --疑問詞
		text = replace(text , 'interrogatif' , '疑問詞')
		text = replace(text , '前綴' , '前綴' )  -- 綴
		text = replace(text , 'préfix' , '前綴' )
		text = replace(text , 'prefix' , '前綴' )
		text = replace(text , '後綴' , '後綴' ) 
		text = replace(text , 'suffixe' , '後綴' ) 
		text = replace(text , '插綴' , '插綴' ) 
		text = replace(text , '中綴' , '中綴' ) 
		text = replace(text , '環綴' , '環綴' ) 
		text = replace(text , '語體標記' , '語體標記' ) -- 語體標記
		text = replace(text , 'mrk_asp' , '語體標記' )
		text = replace(text , '連詞' , '連詞' )
		text = replace(text , '連接' , '連詞' )
		text = replace(text , 'conj' , '連詞' )
		text = replace(text , '縮' , '縮寫' )
		text = replace(text , 'abbr' , '縮寫' )
	return text
end

return export