From 39b23342163626bfeffa31f92856a10f31f305f9 Mon Sep 17 00:00:00 2001 From: ksqsf Date: Mon, 29 Jan 2024 18:26:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=B8=E8=A6=8F=E7=B6=AD=E8=AD=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ~ 改用7z格式壓縮 + 字:㖏䒑 + 詞:模(mu)樣 ~ 簡:翀isy 滿mj 慢mjx 漫mjd 終末vsmo 駐vum 芋yuc 少年un + 簡:凄qidn 沏qidt 漫展mjvj 男朋友npy 批處理pil 其q2 實際上uju 手機上uju + 整句模式增加所有反查功能 + 符號:fcitx顏文字 ~ lua: 改爲傳承字輸出 --- lua/moran_shijian.lua | 32 ++++++++++---------- make_simp_dist.sh | 2 +- moran.chars.dict.yaml | 4 ++- moran.essay.dict.yaml | 2 ++ moran_fixed.dict.yaml | 33 +++++++++++++-------- moran_sentence.schema.yaml | 61 +++++++++++++++++++++++++++++++++++--- symbols.yaml | 21 +++++++++++++ 7 files changed, 121 insertions(+), 34 deletions(-) diff --git a/lua/moran_shijian.lua b/lua/moran_shijian.lua index 689c61a..3eb71af 100644 --- a/lua/moran_shijian.lua +++ b/lua/moran_shijian.lua @@ -780,8 +780,8 @@ end -- ==================节气计算=================== local jqB = { -- 节气表 -"春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", -"秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒", "立春", "雨水", "惊蛰"} +"春分", "清明", "穀雨", "立夏", "小滿", "芒種", "夏至", "小暑", "大暑", "立秋", "處暑", "白露", +"秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒", "立春", "雨水", "驚蟄"} function JQtest(y) -- 节气使计算范例,y是年分,这是个测试函数 local i, q, s1, s2 @@ -1165,8 +1165,8 @@ end -- ====================以下是测试代码============= local jqB = { -- 节气表 -"立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", -"立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒"} +"立春", "雨水", "驚蟄", "春分", "清明", "穀雨", "立夏", "小滿", "芒種", "夏至", "小暑", "大暑", +"立秋", "處暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒"} -- 天干 local tiangan = {'甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'} @@ -1203,7 +1203,7 @@ function lunarJzl(y) didx = x:getDayGanZhi() hidx = x:getHourGanZhi() GzData = get60JiaZiStr(yidx) .. '年' .. get60JiaZiStr(midx) .. '月' .. get60JiaZiStr(didx) .. '日' .. - get60JiaZiStr(hidx) .. '时' + get60JiaZiStr(hidx) .. '時' -- print('干支:' .. GzData) return GzData end @@ -1216,7 +1216,7 @@ end local function chinese_weekday(wday) wday_num = tonumber(wday) + 1 - chinese_weekdays = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"} + chinese_weekdays = {"週日", "週一", "週二", "週三", "週四", "週五", "週六"} return chinese_weekdays[wday_num] end local function chinese_weekday2(wday) @@ -1243,9 +1243,9 @@ end local GetLunarSichen = function(time, t) local time = tonumber(time) - local LunarSichen = {"子时(夜半|三更)", "丑时(鸡鸣|四更)", "寅时(平旦|五更)", - "卯时(日出)", "辰时(食时)", "巳时(隅中)", "午时(日中)", "未时(日昳)", - "申时(哺时)", "酉时(日入)", "戌时(黄昏|一更)", "亥时(人定|二更)"} + local LunarSichen = {"子時(夜半|三更)", "丑時(雞鳴|四更)", "寅時(平旦|五更)", + "卯時(日出)", "辰時(食時)", "巳時(隅中)", "午時(日中)", "未時(日昳)", + "申時(哺時)", "酉時(日入)", "戌時(黄昏|一更)", "亥時(人定|二更)"} if tonumber(t) == 1 then sj = math.floor((time + 1) / 2) + 1 elseif tonumber(t) == 0 then @@ -1414,14 +1414,14 @@ function Date2LunarDate(Gregorian) -- 地支名称 local cDiZhi = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"} -- 属相名称 - local cShuXiang = {"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"} + local cShuXiang = {"鼠", "牛", "虎", "兔", "龍", "蛇", "馬", "羊", "猴", "雞", "狗", "豬"} -- 农历日期名 local cDayName = {"初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十"} -- 农历月份名 local cMonName = {"正月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", - "冬月", "腊月"} + "冬月", "臘月"} -- 农历数据 local wNongliData = {"AB500D2", "4BD0883", "4AE00DB", "A5700D0", "54D0581", "D2600D8", "D9500CC", "655147D", @@ -1523,7 +1523,7 @@ function Date2LunarDate(Gregorian) end -- print(LYear .. "-" .. LMonth .. "-" .. LDay) if Isleap > 0 then - LunarMonth = "闰" .. cMonName[LMonth] + LunarMonth = "閏" .. cMonName[LMonth] else LunarMonth = cMonName[LMonth] end @@ -1781,10 +1781,10 @@ local function QueryLunarInfo(date) DateTime = LunarDate2Date(str, 0) dateRQ = string.sub(str, 1, 4) .. "年" .. string.sub(str, 5, 6) .. "月" .. string.sub(str, 7, 8) .. "日" if LunarGz ~= nil then - result = {{dateRQ, "〔公历〕"}, {LunarDate, "〔公历⇉农历〕"}, {LunarGz, "〔公历⇉干支〕"}} + result = {{dateRQ, "〔公曆〕"}, {LunarDate, "〔公曆⇉農曆〕"}, {LunarGz, "〔公曆⇉干支〕"}} if tonumber(string.sub(str, 7, 8)) < 31 then - table.insert(result, {DateTime, "〔农历⇉公历〕"}) - local leapDate = {LunarDate2Date(str, 1) .. "(闰)", "〔农历⇉公历〕"} + table.insert(result, {DateTime, "〔農曆⇉公曆〕"}) + local leapDate = {LunarDate2Date(str, 1) .. "(閏)", "〔農曆⇉公曆〕"} if string.match(leapDate[1], "^(%d+)") ~= nil then table.insert(result, leapDate) end @@ -1901,7 +1901,7 @@ local function translator(input, seg) -- 星期几 周几 elseif (input == "oweek" or input == "oxq") then weekday = chinese_weekday(os.date("%w")) - num_weekday = os.date("第%W周") + num_weekday = os.date("第%W週") candidate = Candidate("xq", seg.start, seg._end, weekday, num_weekday) yield(candidate) diff --git a/make_simp_dist.sh b/make_simp_dist.sh index 48d9768..61859b8 100755 --- a/make_simp_dist.sh +++ b/make_simp_dist.sh @@ -99,5 +99,5 @@ rm -rf dist/make_simp_dist.sh cp 下载与安装说明.txt 更新纪要.txt dist sedi 's/MORAN_VARIANT/简体/' dist/下载与安装说明.txt -7z a -tzip -mx=9 -r "MoranSimplified-$(date +%Y%m%d).7z" dist +7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on "MoranSimplified-$(date +%Y%m%d).7z" dist rm -rf dist diff --git a/moran.chars.dict.yaml b/moran.chars.dict.yaml index ae2f53d..d3cacb0 100644 --- a/moran.chars.dict.yaml +++ b/moran.chars.dict.yaml @@ -388,7 +388,8 @@ use_preset_vocabulary: false 㖆 qu;kq 0 # auto 㖇 er;ke 0 # auto 㖊 xp;kx 0 # auto -㖏 nx;kn 0 # auto +㖏 nx;kn 0 +㖏 nx;kt 0 㖐 wz;ly 0 # auto 㖑 xx;kj 0 # auto 㖒 ti;kd 0 # auto @@ -54642,6 +54643,7 @@ use_preset_vocabulary: false  pp;yy 0 兀 pp;wu 0 𡭔 pp;xc 0 +䒑 pp;qm 0 #---------- # 其他增補 diff --git a/moran.essay.dict.yaml b/moran.essay.dict.yaml index eb76e70..dba943a 100644 --- a/moran.essay.dict.yaml +++ b/moran.essay.dict.yaml @@ -147482,6 +147482,8 @@ columns: 模樣 mo;mm yh;my 2645 模版 mo;mm bj;pf 1153 模特 mo;mm te;ns 2505 +模樣 mu;mm yh;my 100 +模版 mu;mm bj;pf 100 模特兒 mo;mm te;ns er;ej 847 模特大賽 mo;mm te;ns da;ad sl;bb 1 模範 mo;mm fj;ve 1409 diff --git a/moran_fixed.dict.yaml b/moran_fixed.dict.yaml index 3865082..7da3ace 100644 --- a/moran_fixed.dict.yaml +++ b/moran_fixed.dict.yaml @@ -269,6 +269,7 @@ AA制 aavi 哀痛 aits 愛聽 aity 矮 aiu +砹 aiua 礙手 aiub 碍 aiuc 磑 aiud @@ -24760,7 +24761,7 @@ Bilibili bvj 重寫 isxx 重寫 isxx 寵幸 isxy -衶 isy +翀 isy 蟲牙 isya 衝壓 isya 重遊 isyb @@ -37436,7 +37437,7 @@ Bilibili bvj 迷 miz 蜜棗 mizk 迷醉 mizv -慢 mj +滿 mj 漫筆 mjbi 慢班 mjbj 瞞報 mjbk @@ -37445,13 +37446,12 @@ Bilibili bvj 滿倉 mjch 慢詞 mjci 蔓草 mjck -滿 mjd +漫 mjd 沒精打采 mjdc 慢的 mjde 滿地 mjdi 漫道 mjdk 慢待 mjdl -漫 mjdm 慢點 mjdm 滿點 mjdm 摩加迪沙 mjdu @@ -37556,6 +37556,7 @@ Bilibili bvj 漫說 mjuo 屘 mjuz 沒記住 mjv +漫展 mjvj 滿洲 mjvb 瞞着 mjve 幔帳 mjvh @@ -38719,11 +38720,11 @@ Bilibili bvj 沒事就好 mujh 母雞 muji 募集 muji -鉬 mujo 鉧 mujm 幙 mujm 母艦 mujm 木槿 mujn +鉬 mujo 募捐 mujr 模具 muju 墓碣 mujx @@ -40636,6 +40637,7 @@ Bilibili bvj 泥菩薩過河 npsh 你陪我 npw 女朋友 npy +男朋友 npy 牛 nq 紐埃 nqai 牛扒 nqba @@ -42163,6 +42165,7 @@ PC端 pcdr 劈開 pikl 疲睏 pikp 痞塊 piky +批處理 pil 紕漏 pilb 坯料 pilc 批量 pild @@ -43713,6 +43716,7 @@ PC端 pcdr 配載 pzzl 賠罪 pzzv 去 q +其 q 親愛 qa 親愛的 qad 乞哀告憐 qagl @@ -56295,7 +56299,9 @@ PC端 pcdr 閃退 ujtv 刪帖 ujtx 數據通信 ujtx -失節事大 ujud +實際上 uju +手機上 uju +禪 ujud 閃射 ujue 山神 ujuf 閃身 ujuf @@ -56696,6 +56702,7 @@ PC端 pcdr 聲名遠揚 umyy 什麼樣子 umyz 生米做成熟飯 umzf +少年 un 少女 un 少年不努力 unbl 少年不識愁滋味 unbw @@ -61043,7 +61050,7 @@ PC端 pcdr 種苗 vsmc 指桑罵槐 vsmh 蛛絲馬跡 vsmj -中魔 vsmo +終末 vsmo 朝三暮四 vsms 朝思暮想 vsmx 中美 vsmz @@ -61391,7 +61398,7 @@ PC端 pcdr 誅戮 vulu 豬苓 vuly 燭淚 vulz -柱 vum +駐 vum 苧麻 vuma 主謀 vumb 馵 vumc @@ -61404,9 +61411,8 @@ PC端 pcdr 豬毛 vumk 朝生暮死 vums 矚目 vumu -駐 vumv -柱 vumv 株 vumv +柱 vumv 櫫 vumv 櫧 vumv 櫡 vumv @@ -73184,7 +73190,7 @@ WiFi wifi 痏 yuby 瘉 yuby 預備 yubz -尉 yuc +芋 yuc 薁 yuca 預測 yuce 一手策劃 yuch @@ -73194,6 +73200,7 @@ WiFi wifi 育才 yucl 漁村 yucp 遠勝從前 yucq +尉 yucu 蘌 yucu 蒮 yucv 蔚 yucw @@ -76825,8 +76832,8 @@ WiFi wifi 賊子 zzzi 自作自受 zzzu 自自在在 zzzz -砹 aiua +手機上 快樂水 這麼強 愛不愛 @@ -84586,3 +84593,5 @@ WiFi wifi 向量 xlo 味 wk #跳過韻母 圍 wkw #跳過韻母 +凄 qidn #取「女」 +沏 qidt #qid + tea diff --git a/moran_sentence.schema.yaml b/moran_sentence.schema.yaml index 26a8066..49eb917 100644 --- a/moran_sentence.schema.yaml +++ b/moran_sentence.schema.yaml @@ -53,7 +53,11 @@ engine: - fallback_segmentor translators: - punct_translator - - reverse_lookup_translator + - reverse_lookup_translator@reverse_universal + - reverse_lookup_translator@reverse_tiger + - reverse_lookup_translator@reverse_stroke + - reverse_lookup_translator@reverse_cangjie5 + - reverse_lookup_translator@reverse_zrlf - table_translator@custom_phrase # 自定義短語 #- table_translator@english # 英語混輸 #- table_translator@japanese # 日語混輸 @@ -129,12 +133,57 @@ std_dzing: option_name: std_dzing tips: all -reverse_lookup: +reverse_format: + comment_format: + - xform/(\w\w);(\w\w)/$1[$2]/ + preedit_format: + - xform/^o(lf|bh|cj)// + +reverse_tiger: + tag: reverse_tiger dictionary: tiger enable_completion: true prefix: "`" - suffix: "'" tips: 〔虎碼〕 + __include: reverse_format + +reverse_universal: + tag: reverse_universal + dictionary: moran.chars + tips: 〔通配〕 + __include: reverse_format + +reverse_stroke: + tag: reverse_stroke + dictionary: stroke + prefix: "obh" + enable_completion: true + tips: 〔橫h豎s撇p捺n折z〕 + __include: reverse_format + +reverse_cangjie5: + tag: reverse_cangjie5 + dictionary: cangjie5 + prefix: "ocj" + enable_completion: true + tips: 〔倉頡五代〕 + __include: reverse_format + +reverse_zrlf: + tag: reverse_zrlf + dictionary: zrlf + prefix: "olf" + enable_completion: true + tips: 〔兩分〕 + __include: reverse_format + +reverse_lookup: + extra_tags: + - reverse_tiger + - reverse_universal + - reverse_stroke + - reverse_cangjie5 + - reverse_zrlf punctuator: import_preset: symbols @@ -151,7 +200,11 @@ key_binder: recognizer: import_preset: default patterns: - reverse_lookup: "^`[a-z]*'?$" + reverse_universal: "(^(`[a-z`]+))|(^([a-z]{2}(`[a-z`]?|[a-z`]`)))" + reverse_tiger: "(^`$)|(^`[a-zA-Z]+$)" + reverse_stroke: "^obh[A-Za-z]*$" + reverse_cangjie5: "^ocj[A-Za-z]*$" + reverse_zrlf: "^olf[A-Za-z]*$" punct: '^/([0-9]0?|[A-Za-z]+)$' # 默認啓用語言模型 diff --git a/symbols.yaml b/symbols.yaml index 4d79758..e7f89a3 100644 --- a/symbols.yaml +++ b/symbols.yaml @@ -334,6 +334,27 @@ punctuator: '/pk': ['レ(゚∀゚;)ヘ=З=З=З'] '/shrug': ['¯\_(ツ)_/¯'] '/ssjm': ['¯\_(ツ)_/¯'] + "/rec": ["●REC"] + "/yawn": ["( ̄□ ̄)", "(๑´ڡ`๑)"] + "/point": ["(「・ω・)「"] + "/poke": ["( ´∀`)σ)Д`)"] + "/cry": ["T_T", "(╥_╥)", "(;´༎ຶД༎ຶ`)"] + "/poor": ["(´・ω・`)", "(。・_・。)", "QAQ"] + "/love": ["(。♥‿♥。)", "(✿ ♥‿♥)"] + "/cute": ["(。◕‿◕。)", "(◕‿◕✿)"] + "/smile": ["☺", "~^_^~", "(・∀・)", "ლ(╹◡╹ლ)"] + "/amazed": ["(°Д°)", "( ゚Д゚)σ", "Σ(っ°Д °;)っ"] + "/effort": ["(ง •̀_•́)ง"] + "/bye": ["(。・ω・)ノ"] + "/orz": ["_(:з」∠)_"] + "/throw_table": ["(┙>∧<)┙へ┻┻"] + "/blash": ["o(///▽///)q"] + "/sob": [">_<", "( >﹏<。)"] + "/bear": ["(・ェ-)", "(✪㉨✪)", "( ̄(エ) ̄)"] + "/hi": ["´ ▽ ` )ノ"] + "/kira": ["(ゝ∀・)"] + "/ah": ["´_>`", "(´_>`)", "╮( ̄▽ ̄)╭", "●﹏●"] + # 其他 '/tab': [' '] '/kg': [' ']