Skip to content

Commit

Permalink
常規維護
Browse files Browse the repository at this point in the history
~ 改用7z格式壓縮
+ 字:㖏䒑
+ 詞:模(mu)樣
~ 簡:翀isy 滿mj 慢mjx 漫mjd 終末vsmo 駐vum 芋yuc 少年un
+ 簡:凄qidn 沏qidt 漫展mjvj 男朋友npy 批處理pil 其q2 實際上uju
      手機上uju
+ 整句模式增加所有反查功能
+ 符號:fcitx顏文字
~ lua: 改爲傳承字輸出
  • Loading branch information
ksqsf committed Jan 29, 2024
1 parent 23c5eff commit 39b2334
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 34 deletions.
32 changes: 16 additions & 16 deletions lua/moran_shijian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@ end

-- ==================节气计算===================
local jqB = { -- 节气表
"春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露",
"秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒", "立春", "雨水", "惊蛰"}
"春分", "清明", "穀雨", "立夏", "小滿", "芒種", "夏至", "小暑", "大暑", "立秋", "處暑", "白露",
"秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒", "立春", "雨水", "驚蟄"}

function JQtest(y) -- 节气使计算范例,y是年分,这是个测试函数
local i, q, s1, s2
Expand Down Expand Up @@ -1165,8 +1165,8 @@ end
-- ====================以下是测试代码=============

local jqB = { -- 节气表
"立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑",
"立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒"}
"立春", "雨水", "驚蟄", "春分", "清明", "穀雨", "立夏", "小滿", "芒種", "夏至", "小暑", "大暑",
"立秋", "處暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒"}
-- 天干
local tiangan = {'', '', '', '', '', '', '', '', '', ''}

Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion make_simp_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion moran.chars.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54642,6 +54643,7 @@ use_preset_vocabulary: false
 pp;yy 0
兀 pp;wu 0
𡭔 pp;xc 0
䒑 pp;qm 0
#----------

# 其他增補
Expand Down
2 changes: 2 additions & 0 deletions moran.essay.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 21 additions & 12 deletions moran_fixed.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ AA制 aavi
哀痛 aits
愛聽 aity
矮 aiu
砹 aiua
礙手 aiub
碍 aiuc
磑 aiud
Expand Down Expand Up @@ -24760,7 +24761,7 @@ Bilibili bvj
重寫 isxx
重寫 isxx
寵幸 isxy
isy
isy
蟲牙 isya
衝壓 isya
重遊 isyb
Expand Down Expand Up @@ -37436,7 +37437,7 @@ Bilibili bvj
迷 miz
蜜棗 mizk
迷醉 mizv
mj
滿 mj
漫筆 mjbi
慢班 mjbj
瞞報 mjbk
Expand All @@ -37445,13 +37446,12 @@ Bilibili bvj
滿倉 mjch
慢詞 mjci
蔓草 mjck
滿 mjd
mjd
沒精打采 mjdc
慢的 mjde
滿地 mjdi
漫道 mjdk
慢待 mjdl
漫 mjdm
慢點 mjdm
滿點 mjdm
摩加迪沙 mjdu
Expand Down Expand Up @@ -37556,6 +37556,7 @@ Bilibili bvj
漫說 mjuo
屘 mjuz
沒記住 mjv
漫展 mjvj
滿洲 mjvb
瞞着 mjve
幔帳 mjvh
Expand Down Expand Up @@ -38719,11 +38720,11 @@ Bilibili bvj
沒事就好 mujh
母雞 muji
募集 muji
鉬 mujo
鉧 mujm
幙 mujm
母艦 mujm
木槿 mujn
鉬 mujo
募捐 mujr
模具 muju
墓碣 mujx
Expand Down Expand Up @@ -40636,6 +40637,7 @@ Bilibili bvj
泥菩薩過河 npsh
你陪我 npw
女朋友 npy
男朋友 npy
牛 nq
紐埃 nqai
牛扒 nqba
Expand Down Expand Up @@ -42163,6 +42165,7 @@ PC端 pcdr
劈開 pikl
疲睏 pikp
痞塊 piky
批處理 pil
紕漏 pilb
坯料 pilc
批量 pild
Expand Down Expand Up @@ -43713,6 +43716,7 @@ PC端 pcdr
配載 pzzl
賠罪 pzzv
去 q
其 q
親愛 qa
親愛的 qad
乞哀告憐 qagl
Expand Down Expand Up @@ -56295,7 +56299,9 @@ PC端 pcdr
閃退 ujtv
刪帖 ujtx
數據通信 ujtx
失節事大 ujud
實際上 uju
手機上 uju
禪 ujud
閃射 ujue
山神 ujuf
閃身 ujuf
Expand Down Expand Up @@ -56696,6 +56702,7 @@ PC端 pcdr
聲名遠揚 umyy
什麼樣子 umyz
生米做成熟飯 umzf
少年 un
少女 un
少年不努力 unbl
少年不識愁滋味 unbw
Expand Down Expand Up @@ -61043,7 +61050,7 @@ PC端 pcdr
種苗 vsmc
指桑罵槐 vsmh
蛛絲馬跡 vsmj
中魔 vsmo
終末 vsmo
朝三暮四 vsms
朝思暮想 vsmx
中美 vsmz
Expand Down Expand Up @@ -61391,7 +61398,7 @@ PC端 pcdr
誅戮 vulu
豬苓 vuly
燭淚 vulz
vum
vum
苧麻 vuma
主謀 vumb
馵 vumc
Expand All @@ -61404,9 +61411,8 @@ PC端 pcdr
豬毛 vumk
朝生暮死 vums
矚目 vumu
駐 vumv
柱 vumv
株 vumv
柱 vumv
櫫 vumv
櫧 vumv
櫡 vumv
Expand Down Expand Up @@ -73184,7 +73190,7 @@ WiFi wifi
痏 yuby
瘉 yuby
預備 yubz
yuc
yuc
薁 yuca
預測 yuce
一手策劃 yuch
Expand All @@ -73194,6 +73200,7 @@ WiFi wifi
育才 yucl
漁村 yucp
遠勝從前 yucq
尉 yucu
蘌 yucu
蒮 yucv
蔚 yucw
Expand Down Expand Up @@ -76825,8 +76832,8 @@ WiFi wifi
賊子 zzzi
自作自受 zzzu
自自在在 zzzz
砹 aiua

手機上
快樂水
這麼強
愛不愛
Expand Down Expand Up @@ -84586,3 +84593,5 @@ WiFi wifi
向量 xlo
味 wk #跳過韻母
圍 wkw #跳過韻母
凄 qidn #取「女」
沏 qidt #qid + tea
61 changes: 57 additions & 4 deletions moran_sentence.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 # 日語混輸
Expand Down Expand Up @@ -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
Expand All @@ -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]+)$'

# 默認啓用語言模型
Expand Down
Loading

0 comments on commit 39b2334

Please sign in to comment.