Skip to content

Commit

Permalink
update with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jack2game committed May 24, 2024
1 parent 13ba130 commit 8686c79
Show file tree
Hide file tree
Showing 82 changed files with 19,058 additions and 18,990 deletions.
2 changes: 1 addition & 1 deletion make_xhupkai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rm -rf ./xhupkai-cht/.gitignore
rm -rf ./xhupkai-cht/README.md
rm -rf ./xhupkai-cht/README-en.md
rm -rf ./xhupkai-cht/.github/
perl -CSAD -i -pe 's/(^.*ZRM-SPECIFIC)/# $1/' ./xhupmoqi/moran.yaml
perl -CSAD -i -pe 's/(^.*ZRM-SPECIFIC)/# $1/' ./xhupkai-cht/moran.yaml
# mv ./xhupkai-cht/key_bindings.yaml ./schema
# mv ./xhupkai-cht/punctuation.yaml ./schema

Expand Down
2 changes: 1 addition & 1 deletion make_xhupmoqi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rm -rf ./xhupmoqi-cht/.gitignore
rm -rf ./xhupmoqi-cht/README.md
rm -rf ./xhupmoqi-cht/README-en.md
rm -rf ./xhupmoqi-cht/.github/
perl -CSAD -i -pe 's/(^.*ZRM-SPECIFIC)/# $1/' ./xhupmoqi/moran.yaml
perl -CSAD -i -pe 's/(^.*ZRM-SPECIFIC)/# $1/' ./xhupmoqi-cht/moran.yaml
# mv ./xhupmoqi-cht/key_bindings.yaml ./schema
# mv ./xhupmoqi-cht/punctuation.yaml ./schema
cp ./rime-shuangpin-fuzhuma/opencc/moqi_chaifen.txt ./xhupmoqi-cht/opencc/moran_chaifen.txt
Expand Down
2 changes: 1 addition & 1 deletion make_xhupzrmfast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rm -rf ./xhupzrmfast-cht/.gitignore
rm -rf ./xhupzrmfast-cht/README.md
rm -rf ./xhupzrmfast-cht/README-en.md
rm -rf ./xhupzrmfast-cht/.github/
perl -CSAD -i -pe 's/(^.*ZRM-SPECIFIC)/# $1/' ./xhupmoqi/moran.yaml
perl -CSAD -i -pe 's/(^.*ZRM-SPECIFIC)/# $1/' ./xhupzrmfast-cht/moran.yaml
# mv ./xhupzrmfast-cht/key_bindings.yaml ./schema
# mv ./xhupzrmfast-cht/punctuation.yaml ./schema
# cp ./rime-shuangpin-fuzhuma/opencc/moqi_chaifen.txt ./xhupzrmfast-cht/opencc/moran_chaifen.txt
Expand Down
6 changes: 3 additions & 3 deletions molong-chs/lua/moran_charset_comment_filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ local charset = {
["[线性文字A]"] = { first = 0x10600, last = 0x1077f },
["[拉丁语扩展-F]"] = { first = 0x10780, last = 0x107bf },
["[塞浦路斯语音节]"] = { first = 0x10800, last = 0x1083f },
["[帝国阿拉姆語]"] = { first = 0x10840, last = 0x1085f },
["[帝国阿拉姆语]"] = { first = 0x10840, last = 0x1085f },
["[巴尔米拉字母]"] = { first = 0x10860, last = 0x1087f },
["[纳巴泰字母]"] = { first = 0x10880, last = 0x108af },
["[哈特兰字母]"] = { first = 0x108e0, last = 0x108ff },
Expand All @@ -215,7 +215,7 @@ local charset = {
["[碑刻帕提亚文]"] = { first = 0x10b40, last = 0x10b5f },
["[碑刻巴列维文]"] = { first = 0x10b60, last = 0x10b7f },
["[诗篇巴列维文]"] = { first = 0x10b80, last = 0x10baf },
["[古代突厥語]"] = { first = 0x10c00, last = 0x10c4f },
["[古代突厥语]"] = { first = 0x10c00, last = 0x10c4f },
["[古匈牙利字母]"] = { first = 0x10c80, last = 0x10cff },
["[哈乃斐罗兴亚文字]"] = { first = 0x10d00, last = 0x10d3f },
["[鲁米数字符号]"] = { first = 0x10e60, last = 0x10e7f },
Expand Down Expand Up @@ -442,7 +442,7 @@ local function is_cjk_ext(c)
is_charset("帕尔迈拉文字")(c) or is_charset("纳巴泰文")(c) or
is_charset("哈特拉文")(c) or is_charset("腓尼基文")(c) or
is_charset("吕底亚文")(c) or is_charset("麦罗埃象形文字")(c) or
is_charset("麦罗埃草书文字")(c) or is_charset("佉卢虱吒文")(c) or
is_charset("麦罗埃草书文字")(c) or is_charset("佉卢虱咤文")(c) or
is_charset("古南阿拉伯文")(c) or is_charset("古北阿拉伯文")(c) or
is_charset("摩尼文")(c) or is_charset("阿维斯陀文")(c) or
is_charset("帕提亚碑铭体文字")(c) or is_charset("巴列维碑铭体文字")(c) or
Expand Down
6 changes: 4 additions & 2 deletions molong-chs/lua/moran_express_translator.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
-- Moran Translator (for Express Editor)
-- Copyright (c) 2023, 2024 ksqsf
--
-- Ver: 0.6.0
-- Ver: 0.6.1
--
-- This file is part of Project Moran
-- Licensed under GPLv3
--
-- 0.6.1: show_words_anyway 在四碼時跳過二字詞。
--
-- 0.6.0: 增加 show_chars_anyway 和 show_words_anyway 設置,允許將
-- fixed 碼表的單字全碼放置在第二位,不再需要打全碼。如輸入「jwrg」就
-- 可以在第二位得到「佳」,按分號選取之。
Expand Down Expand Up @@ -121,7 +123,7 @@ function top.func(input, seg, env)
env.output_injected_secondary = {}
if (not fixed_triggered and input_len == 4) then
for cand in moran.query_translation(env.fixed, input, seg, nil) do
if (env.show_chars_anyway and utf8.len(cand.text) == 1) or (env.show_words_anyway and utf8.len(cand.text) > 1) then
if (env.show_chars_anyway and utf8.len(cand.text) == 1) or (env.show_words_anyway and utf8.len(cand.text) > 1 and input_len ~= 4) then
cand:get_genuine().comment = indicator
table.insert(env.output_injected_secondary, cand)
end
Expand Down
46 changes: 23 additions & 23 deletions molong-chs/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 All @@ -1918,9 +1918,9 @@ local function translator(input, seg)
yield(candidate)
elseif (input == "oww") then
weekno = string.gsub(os.date("%W"), "^0+", "")
candidate = Candidate("oww", seg.start, seg._end, "W" .. weekno, "")
candidate = Candidate("oww", seg.start, seg._end, "W" .. weekno, "")
yield(candidate)
candidate = Candidate("oww", seg.start, seg._end, "" .. weekno .. "", "")
candidate = Candidate("oww", seg.start, seg._end, "" .. weekno .. "", "")
yield(candidate)
-- 节气 已修复崩溃问题
elseif (input == "ojq") then
Expand All @@ -1942,13 +1942,13 @@ local function translator(input, seg)
end
end
end -- if tonumber
-- ISO 8601 / RFC 3339 的時間格式 (固定東八區
-- ISO 8601 / RFC 3339 的时间格式 (固定东八区
elseif (input == "ors") then
local current_time = os.time()
yield(Candidate(input, seg.start, seg._end, os.date('%Y-%m-%d %H:%M:%S', current_time), "年-月-日 :分:秒"))
yield(Candidate(input, seg.start, seg._end, os.date('%Y-%m-%dT%H:%M:%S+08:00', current_time), "年-月-日T時:分:秒+時區"))
yield(Candidate(input, seg.start, seg._end, os.date('%Y%m%d%H%M%S', current_time), "年月日時分秒"))
-- Unix Epoch Clock / Timestamp 時間格式
yield(Candidate(input, seg.start, seg._end, os.date('%Y-%m-%d %H:%M:%S', current_time), "年-月-日 :分:秒"))
yield(Candidate(input, seg.start, seg._end, os.date('%Y-%m-%dT%H:%M:%S+08:00', current_time), "年-月-日T时:分:秒+时区"))
yield(Candidate(input, seg.start, seg._end, os.date('%Y%m%d%H%M%S', current_time), "年月日时分秒"))
-- Unix Epoch Clock / Timestamp 时间格式
elseif (input == "oepoch") then
local current_time = os.time()
yield(Candidate(input, seg.start, seg._end, string.format('%d', current_time), "Unix Timestamp"))
Expand Down
13 changes: 5 additions & 8 deletions molong-chs/lua/zrmdb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27488,6 +27488,7 @@
輦 if
輧 ib
輨 ig
輩 if
輩 fi
輪 il
輫 if
Expand Down Expand Up @@ -72843,8 +72844,7 @@
𩓭 yp
𩓮 ym
𩓮 hy
𩓯 vy
𩓯 yp
𩓯 yx
𩓰 cy
𩓰 yc
𩓱 uy
Expand Down Expand Up @@ -72937,8 +72937,7 @@
𩔣 dy
𩔣 vy
𩔣 yv
𩔤 vy
𩔤 yp
𩔤 yx
𩔥 ys
𩔦 yv
𩔧 jy
Expand Down Expand Up @@ -73032,8 +73031,7 @@
𩕖 vy
𩕗 ty
𩕗 yt
𩕘 ay
𩕘 yp
𩕘 yx
𩕛 sy
𩕛 ys
𩕜 yk
Expand All @@ -73059,8 +73057,7 @@
𩕦 dy
𩕦 yo
𩕧 yl
𩕨 vy
𩕨 yp
𩕨 yx
𩕩 oy
𩕩 yj
𩕪 yq
Expand Down
1 change: 1 addition & 0 deletions molong-chs/moran.words.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7146,6 +7146,7 @@ columns:
脱宅 300
能指链
诺奖 1000
硬啃 1111

哆啦A梦 100 do;kd la;kl aa mg;cx
哆啦A梦 100 do;kd la;kl ei mg;cx
Expand Down
6 changes: 5 additions & 1 deletion molong-chs/moran.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ algebra:
- abbrev/^(.+);(\w)(\w)$/$1$2$3/ # 降低 YYXX 優先級
- derive/^(.+);(\w)(\w)$/$1$2/ # 構詞可以用 YYX
- derive/^(.+);(\w)(\w)$/$1/ # 構詞可以用 YY
# ZRM-SPECIFIC: 特殊優化:部分音節字極少,幾乎不參與構詞,則提升對應四碼字的優先級
# ZRM-SPECIFIC: (僅對自然碼雙拼有效,其他雙拼方案需作對應修改)
- derive/^(.+);(bd|dw|df|dw|yl|rw)$/$1$2/ # ZRM-SPECIFIC
- erase/^(.+);(.+)$/ # 刪除原始編碼以加速檢索

key_bindings:
Expand All @@ -55,7 +58,7 @@ key_bindings:
- { when: has_menu, accept: "Control+s", toggle: traditionalization }
- { when: has_menu, accept: "Control+u", toggle: unicode_comment }
- { when: has_menu, accept: "Control+q", toggle: emoji }
- { when: has_menu, accept: "Control+x", toggle: extended_charset }
- { when: composing, accept: "Control+x", toggle: extended_charset }
- { when: has_menu, accept: "Control+Shift+0", toggle: std_opencc }
- { when: has_menu, accept: "Control+i", toggle: chaifen }

Expand Down Expand Up @@ -98,6 +101,7 @@ octagram:
__patch:
grammar:
language: zh-hans-t-essay-bgw
#language: zh-hant-t-huayu-bgw
collocation_max_length: 4
collocation_min_length: 2
enable_for_fixed:
Expand Down
1 change: 1 addition & 0 deletions molong-chs/moran_english.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57144,3 +57144,4 @@ Unicode unicode
μTorrent utorrent
online online
döner doner
wiki wiki
10 changes: 5 additions & 5 deletions molong-chs/opencc/moran_chaifen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23180,7 +23180,7 @@
輦 〔車夫if〕
輧 〔車并ib〕
輨 〔車官ig〕
輩 〔非車fi〕
輩 〔車非if〕〔非車fi〕
輪 〔車侖il〕
輫 〔車非if〕
輬 〔車京ij〕
Expand Down Expand Up @@ -59855,7 +59855,7 @@
𩓬 〔.yw〕〔頁木ym〕〔勿頁wy〕
𩓭 〔彡頁py〕〔頁丕yp〕
𩓮 〔頁木ym〕〔火頁hy〕
𩓯 〔止頁vy〕〔頁丿yp
𩓯 〔頁小yx
𩓰 〔采頁cy〕〔頁采yc〕
𩓱 〔舍頁uy〕〔頁舍yu〕
𩓲 〔产頁iy〕
Expand Down Expand Up @@ -59907,7 +59907,7 @@
𩔡 〔.yd〕〔.yy〕
𩔢 〔頁迷ym〕〔迷頁my〕
𩔣 〔.dy〕〔旃頁vy〕〔頁旃yv〕
𩔤 〔止頁vy〕〔頁丿yp
𩔤 〔頁小yx
𩔥 〔頁素ys〕
𩔦 〔頁追yv〕
𩔧 〔家頁jy〕〔頁家yj〕
Expand Down Expand Up @@ -59958,7 +59958,7 @@
𩕕 〔.ym〕〔艹頁cy〕〔頁朋yp〕
𩕖 〔.yu〕〔頁寸yc〕〔爫頁vy〕
𩕗 〔替頁ty〕〔頁替yt〕
𩕘 〔丨頁ay〕〔頁丿yp
𩕘 〔頁小yx
𩕛 〔糸頁sy〕〔頁糸ys〕
𩕜 〔頁逵yk〕〔逵頁ky〕
𩕝 〔彦頁yy〕
Expand All @@ -59972,7 +59972,7 @@
𩕥 〔穴頁xy〕〔頁隹yv〕
𩕦 〔大頁dy〕〔頁目yo〕
𩕧 〔頁六yl〕
𩕨 〔止頁vy〕〔頁丿yp
𩕨 〔頁小yx
𩕩 〔目頁oy〕〔頁斤yj〕
𩕪 〔.yq〕〔罒頁sy〕
𩕫 〔艹頁cy〕〔頁目yo〕
Expand Down
6 changes: 4 additions & 2 deletions molong-cht/lua/moran_express_translator.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
-- Moran Translator (for Express Editor)
-- Copyright (c) 2023, 2024 ksqsf
--
-- Ver: 0.6.0
-- Ver: 0.6.1
--
-- This file is part of Project Moran
-- Licensed under GPLv3
--
-- 0.6.1: show_words_anyway 在四碼時跳過二字詞。
--
-- 0.6.0: 增加 show_chars_anyway 和 show_words_anyway 設置,允許將
-- fixed 碼表的單字全碼放置在第二位,不再需要打全碼。如輸入「jwrg」就
-- 可以在第二位得到「佳」,按分號選取之。
Expand Down Expand Up @@ -121,7 +123,7 @@ function top.func(input, seg, env)
env.output_injected_secondary = {}
if (not fixed_triggered and input_len == 4) then
for cand in moran.query_translation(env.fixed, input, seg, nil) do
if (env.show_chars_anyway and utf8.len(cand.text) == 1) or (env.show_words_anyway and utf8.len(cand.text) > 1) then
if (env.show_chars_anyway and utf8.len(cand.text) == 1) or (env.show_words_anyway and utf8.len(cand.text) > 1 and input_len ~= 4) then
cand:get_genuine().comment = indicator
table.insert(env.output_injected_secondary, cand)
end
Expand Down
Loading

0 comments on commit 8686c79

Please sign in to comment.