Compare commits

...

No commits in common. "033b124b902d14d91ef3e9635d36a154fde94b71" and "0fad2de35c9a3e27a71adaaee5f256602ae3d717" have entirely different histories.

65 changed files with 1666835 additions and 8867 deletions

33
.gitignore vendored
View File

@ -1,28 +1,5 @@
# build output
dist/
# generated types
.astro/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store
# jetbrains setting folder
.idea/
# ignore test articles except for article definitions
src/content/*
!src/content/config.ts
build/
installation.yaml
user.yaml
default.custom.yaml
weasel.custom.yaml

View File

@ -1,4 +0,0 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}

11
.vscode/launch.json vendored
View File

@ -1,11 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}

View File

@ -1 +1,54 @@
个人资料、文章与工具站点。由 Astro 框架构建,使用 typescript 编写。
关于本方案的更多介绍请查看 [关于 Rime 输入法的思考](https://note.lishouzhong.com/article/wiki/Rime%20%E8%BE%93%E5%85%A5%E6%B3%95.html) 。
**由于五笔 86 方案中包含私有码表 (Win10 1809 内置的 86 五笔码表),故此配置仅用于个人学习与交流。**
## 配置说明
所有方案默认不开启用户造词词库功能,有需要的用户需请自行开启。
## 五笔方案
五笔输入法使用 86 版,词库主体采用大单字库 + 小词库的方案。
Rime 官方的 86 五笔词库 [rime-wubi](https://github.com/rime/rime-wubi) 来源于 [acevery/ibus-table-wubi](https://github.com/acevery/ibus-table-wubi/blob/master/tables/wubi86.txt) 项目 ,但由于上游词库的码表里有很多错误的编码,直到 2015 年才被 Rime 用户发现并被 Rime 官方修复,[详情见此](https://github.com/rime/brise/issues/90#issuecomment-110983278)。针对错误编码的补丁只存在于 Rime 官方的 rime-wubi 词库中,没有被反馈给上游的 ibus-table-wubi。这个词库错误较多缺少维护故不考虑使用。
另一个没有版权问题的词库是窝子 (Wozy) 创建的极爽词库,窝子在 2020 年将极爽五笔词库授权给了 Rime 官方使用,[详情见此](https://github.com/rime/rime-wubi/pull/3#issuecomment-577035306)。但是极爽词库已经很久没有维护过了,因此极爽词库中的码表所包含的汉字也并不全面,只有 11589 个,在输入古汉语时经常找不到字。
目前可以找到的比较完整的码表是 Windows 10 操作系统自带的微软五笔的码表,共计 31900 个字。微软(中国)有限公司也是 [GB 18030-2022](https://std.samr.gov.cn/gb/search/gbDetailed?id=E4A2A4C875726A5DE05397BE0A0A61E8) 的起草单位,自家产品应该会遵循自家标准。所以本方案的五笔方案部分将使用此码表。
但微软五笔码表一共有 534114 个词条,去除单字后还有 502214 个词条,不符合小词库的要求。又考虑到,虽然极爽词库收录的单字并不全面,但它的常用词词库已经非常成熟,所以把极爽词库中的单字部分去除保留词组部分可以直接得到一个小体积的词库。
所以最终词库码表的组成是: 微软五笔的单字码表 + 极爽词库的多字词码表。
有两个可以选择的词库,一个是让极点五笔成名的极爽 4.3 词库,另一个是从极爽 4.3 改进来的极爽 6.0 词库。考虑到极爽 4.3 比 6.0 出名得多,所以决定使用极爽 4.3 作为小词库的来源。极爽 4.3 词库中共有 88543 个词条,其中包含 61432 个词组,符合小词库的要求。
最终,五笔方案的词库构成为:
- 词库主体:
- 微软五笔词库的单字码表
- 极爽 4.3 词库的多字词码表
- 其他词库:
- [KyleBing/rime-wubi86-jidian](https://github.com/KyleBing/rime-wubi86-jidian) 中取行政区划词库码表
- 用户私有词库码表
## 拼音方案
本方案的拼音输入法使用双拼 (自然码) 和全拼两种方案,可以自行切换。
双拼输入法在解析时会被映射到全拼上面,所以双拼输入法没有自己的词库。
最终,全拼词库的构成为:
- 词库主体:
- Rime 官方的袖珍简化字 [rime-pinyin-simp](https://github.com/rime/rime-pinyin-simp) 方案的词库 (上游词库为安卓开源项目)
- 维基百科中文词条库 <https://github.com/felixonmars/fcitx5-pinyin-zhwiki>
- 其他词库:
- 用户私有词库
## 其他方案
英文输入法来源于 easy_en 项目,作者为 [Patricivs](https://github.com/Patricivs)。
笔画输入法来源于 Rime 官方的 [rime-stroke](https://github.com/rime/rime-stroke) 方案,主要用于反查。
中文数字输入法根据 Rime 官方教程 *数字之道* 修改而来。

View File

@ -1,47 +0,0 @@
import { defineConfig } from 'astro/config';
import sitemap from "@astrojs/sitemap";
import vue from "@astrojs/vue";
import remarkToc from 'remark-toc';
// https://astro.build/config
export default defineConfig({
markdown: {
smartypants: false,
syntaxHighlight: 'shiki',
shikiConfig: {
// Choose from Shiki's built-in themes (or add your own)
// https://shiki.style/themes
theme: 'github-light',
// Alternatively, provide multiple themes
// See note below for using dual light/dark themes
themes: {
light: 'github-light',
dark: 'github-dark'
},
// Add custom languages
// Note: Shiki has countless langs built-in, including .astro!
// https://shiki.style/languages
langs: [],
// Enable word wrap to prevent horizontal scrolling
wrap: false,
// Add custom transformers: https://shiki.style/guide/transformers
// Find common transformers: https://shiki.style/packages/transformers
transformers: []
},
remarkPlugins: [
[remarkToc, { heading: "(table[ -]of[ -])?contents?|toc|目录" }]
],
},
site: 'https://lishouzhong.com',
integrations: [
sitemap({
// entryLimit: 10000,
// customPages: [],
// filter: (page) => { },
// lastmod: new Date('2022-02-24'),
// serialize(item) {
// return item;
// }
}),
vue()]
});

62
default.yaml Normal file
View File

@ -0,0 +1,62 @@
# Rime default settings
# encoding: utf-8
# customized from Rime default.yaml v0.40
config_version: '0.40'
schema_list:
- schema: wubi_86
- schema: pinyin_zrm
- schema: pinyin
- schema: easy_en
- schema: zh_numbers
- schema: stroke
switcher:
caption: (方案选单)
hotkeys:
- Control+grave
save_options:
- ascii_mode
- full_shape
- ascii_punct
- zh_trad
fold_options: true
abbreviate_options: true
option_list_separator: '/'
menu:
page_size: 5
punctuator:
full_shape:
__include: punctuation:/full_shape
half_shape:
__include: punctuation:/half_shape
key_binder:
bindings:
__patch:
- key_bindings:/emacs_editing
- key_bindings:/move_by_word_with_tab
- key_bindings:/paging_with_minus_equal
- key_bindings:/paging_with_comma_period
- key_bindings:/numbered_mode_switch
- key_bindings:/quick_selection
- key_bindings:/quick_switch_for_vim
recognizer:
patterns:
email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
ascii_composer:
good_old_caps_lock: true
switch_key:
Shift_L: inline_ascii
Shift_R: commit_text
Control_L: noop
Control_R: noop
Caps_Lock: clear
Eisu_toggle: clear

108982
easy_en.dict.yaml Normal file

File diff suppressed because it is too large Load Diff

74
easy_en.schema.yaml Normal file
View File

@ -0,0 +1,74 @@
# encoding: utf-8
# Rime schema settings
#
# Changelog
#
# 2024-02-25 Li Ding <ld.sino@outlook.com>
# - add lua translator date_time_translator
#
schema:
schema_id: easy_en
name: Easy English
version: "0.2"
author:
- Patrick <ipatrickmac@gmail.com>
description:
Easy English
switches:
- name: ascii_mode
reset: 0
states: [ On, Off ]
engine:
processors:
- ascii_composer
- key_binder
- speller
- recognizer
- punctuator
- selector
- navigator
- express_editor
segmentors:
- matcher
- ascii_segmentor
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- table_translator
- punct_translator
- lua_translator@date_time_translator
filters:
- uniquifier
speller:
alphabet: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA-_
delimiter: " '"
translator:
dictionary: easy_en # search on <dictionary>.dict.yaml file
enable_charset_filter: true # 使用字符集过滤
encode_commit_history: false # 对已上屏的词自动成词
enable_encoder: false # 使用自动造词,允许新词进入用户词典
enable_sentence: false # 使用自动造句
enable_user_dict: false # 是否生成 .userdb 用户词典。用户词典记录动态字词频,用户词。
spelling_hints: 9
key_binder:
import_preset: default
punctuator:
full_shape:
__include: punctuation:/full_shape
half_shape:
__include: punctuation:/half_shape
symbols:
__include: symbols:/symbols
recognizer:
import_preset: default
patterns:
punct: "^/([0-9]+[a-z]*|[a-z]+)$" # symbol 用的

6
fcitx5.yaml Normal file
View File

@ -0,0 +1,6 @@
# Fcitx5 settings
# encoding: utf-8
config_version: "0.22"
app_options: {}

74
key_bindings.yaml Normal file
View File

@ -0,0 +1,74 @@
# Rime key bindings
# encoding: utf-8
emacs_editing:
__append:
- { when: composing, accept: Control+p, send: Up }
- { when: composing, accept: Control+n, send: Down }
- { when: composing, accept: Control+b, send: Left }
- { when: composing, accept: Control+f, send: Right }
- { when: composing, accept: Control+a, send: Home }
- { when: composing, accept: Control+e, send: End }
- { when: composing, accept: Control+d, send: Delete }
- { when: composing, accept: Control+k, send: Shift+Delete }
- { when: composing, accept: Control+h, send: BackSpace }
- { when: composing, accept: Control+g, send: Escape }
- { when: composing, accept: Control+bracketleft, send: Escape }
- { when: composing, accept: Control+y, send: Page_Up }
- { when: composing, accept: Alt+v, send: Page_Up }
- { when: composing, accept: Control+v, send: Page_Down }
move_by_word_with_tab:
__append:
- { when: composing, accept: ISO_Left_Tab, send: Shift+Left }
- { when: composing, accept: Shift+Tab, send: Shift+Left }
- { when: composing, accept: Tab, send: Shift+Right }
paging_with_minus_equal:
__append:
- { when: has_menu, accept: minus, send: Page_Up }
- { when: has_menu, accept: equal, send: Page_Down }
paging_with_comma_period:
__append:
- { when: paging, accept: comma, send: Page_Up }
- { when: has_menu, accept: period, send: Page_Down }
numbered_mode_switch:
__append:
- { when: always, accept: Control+Shift+1, select: .next }
- { when: always, accept: Control+Shift+2, toggle: ascii_mode }
- { when: always, accept: Control+Shift+3, toggle: full_shape }
- { when: always, accept: Control+Shift+4, toggle: simplification }
- { when: always, accept: Control+Shift+5, toggle: extended_charset }
- { when: always, accept: Control+Shift+exclam, select: .next }
- { when: always, accept: Control+Shift+at, toggle: ascii_mode }
- { when: always, accept: Control+Shift+numbersign, toggle: full_shape }
- { when: always, accept: Control+Shift+dollar, toggle: simplification }
- { when: always, accept: Control+Shift+percent, toggle: extended_charset }
quick_selection:
__append:
- { when: has_menu, accept: semicolon, send: 2 }
- { when: has_menu, accept: apostrophe, send: 3 }
- { when: paging, accept: bracketleft, send: 4 }
- { when: has_menu, accept: bracketright, send: 5 }
- { when: has_menu, accept: backslash, send: Escape}
quick_switch_for_vim:
__append:
- { when: always, accept: Release+Escape, toggle: ascii_mode}
windows_compatible_mode_switch:
__append:
- { when: always, accept: Shift+space, toggle: full_shape }
- { when: always, accept: Control+period, toggle: ascii_punct }
optimized_mode_switch:
__append:
- { when: always, accept: Control+Shift+space, select: .next }
- { when: always, accept: Shift+space, toggle: ascii_mode }
- { when: always, accept: Control+comma, toggle: full_shape }
- { when: always, accept: Control+period, toggle: ascii_punct }
- { when: always, accept: Control+slash, toggle: simplification }
- { when: always, accept: Control+backslash, toggle: extended_charset }

View File

@ -0,0 +1,29 @@
local function date_time_translator(input, seg)
if (input == "/dd") then
--- Candidate(type, start, end, text, comment)
yield(Candidate("date", seg.start, seg._end, os.date("%m月%d日"), ""))
yield(Candidate("date", seg.start, seg._end, os.date("%Y年%m月%d日"), ""))
yield(Candidate("date", seg.start, seg._end, os.date("%m-%d"), ""))
yield(Candidate("date", seg.start, seg._end, os.date("%Y-%m-%d"), ""))
yield(Candidate("date", seg.start, seg._end, os.date("%Y/%m/%d"), ""))
end
if (input == "/tt") then
yield(Candidate("time", seg.start, seg._end, os.date("%H:%M"), ""))
yield(Candidate("time", seg.start, seg._end, os.date("%H:%M:%S"), ""))
end
if (input == "/ww") then
local weakTabZh = {'', '', '', '', '', '', ''}
local weakTabEnSimp = {'Sun', 'Mon', 'Thues', 'Wed', 'Thur', 'Fri', 'Sat'}
local weakTabEnFull = {'Sunday', 'Monday', 'Thuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'}
yield(Candidate("week", seg.start, seg._end, ""..weakTabZh[tonumber(os.date("%w")+1)], ""))
yield(Candidate("week", seg.start, seg._end, "星期"..weakTabZh[tonumber(os.date("%w")+1)], ""))
yield(Candidate("week", seg.start, seg._end, weakTabEnSimp[tonumber(os.date("%w")+1)], ""))
yield(Candidate("week", seg.start, seg._end, weakTabEnFull[tonumber(os.date("%w")+1)], ""))
end
if (input == "/mm") then
yield(Candidate("month", seg.start, seg._end, os.date("%B"), ""))
yield(Candidate("month", seg.start, seg._end, os.date("%b"), "缩写"))
end
end
return date_time_translator

7406
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
{
"name": "ld-site",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/sitemap": "^3.1.5",
"@astrojs/vue": "^4.5.0",
"astro": "^4.9.2",
"bignumber.js": "^9.1.2",
"pinyin-pro": "^3.22.0",
"remark-toc": "^9.0.0",
"typescript": "^5.4.5",
"vue": "^3.4.29"
}
}

24
pinyin.dict.yaml Normal file
View File

@ -0,0 +1,24 @@
# encoding: utf-8
# Rime dictionary
#
# Original table author
# Li Ding <ld.sino@outlook.com>
#
# Changelog
#
# 2022-09-14 Li Ding <ld.sino@outlook.com>
# - add pinyin_open_source_proj.dict.yaml as dict
# - add pinyin.zhwiki20220722.dict.yaml as dict
#
# 2024-02-25 Li Ding <ld.sino@outlook.com>
# - add pinyin_user.dict.yaml as user dict
# - reorganize dict structure
---
name: pinyin
version: "0.1"
import_tables:
- pinyin_open_source_proj
- pinyin.zhwiki20220722
- pinyin_user
...

125
pinyin.schema.yaml Normal file
View File

@ -0,0 +1,125 @@
# encoding: utf-8
# Rime schema settings
#
# Original schema author
# Li Ding <ld.sino@outlook.com>
#
# Changelog
#
schema:
schema_id: pinyin
name: "全拼"
version: "2024.02.25"
author:
- Li Ding <ld.sino@outlook.com>
description: |
词库来源于安卓拼音与 fcitx5-pinyin-zhwiki 项目。
dependencies:
- stroke # 反查
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
reset: 0
states: [ 半角, 全角 ]
- name: ascii_punct
reset: 0
states: [ 。,, ]
- name: zh_trad
reset: 0
states: [ 简体, 繁体 ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- script_translator
- reverse_lookup_translator
- table_translator
- lua_translator@date_time_translator
filters:
- simplifier
- uniquifier
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- abbrev/^([a-z]).+$/$1/
- abbrev/^([zcs]h).+$/$1/
- derive/^([nl])ue$/$1ve/
- derive/^([jqxy])u/$1v/
- derive/un$/uen/
- derive/ui$/uei/
- derive/iu$/iou/
- derive/([aeiou])ng$/$1gn/
- derive/([dtngkhrzcs])o(u|ng)$/$1o/
- derive/ong$/on/
- derive/ao$/oa/
- derive/([iu])a(o|ng?)$/a$1$2/
translator:
dictionary: pinyin # search on <dictionary>.dict.yaml file
enable_charset_filter: true # 使用字符集过滤
encode_commit_history: false # 对已上屏的词自动成词
enable_encoder: false # 使用自动造词,允许新词进入用户词典
enable_sentence: false # 使用自动造句
enable_user_dict: false # 是否生成 .userdb 用户词典。用户词典记录动态字词频,用户词。
# max_phrase_length: 4 # 最大自动成词的词长,开启用户词典后生效
preedit_format:
- xform/([nl])v/$1ü/
- xform/([nl])ue/$1üe/
- xform/([jqxy])v/$1u/
reverse_lookup:
dictionary: stroke
enable_completion: true
prefix: "`"
suffix: "'"
tips: 〔笔画〕
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format:
- xform/([nl])v/$1ü/
punctuator:
full_shape:
__include: punctuation:/full_shape
half_shape:
__include: punctuation:/half_shape
symbols:
__include: symbols:/symbols
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
punct: "^/([0-9]+[a-z]*|[a-z]+)$" # symbol 用的
reverse_lookup: "`[a-z]*'?$" # 笔画反查用的
simplifier:
# 简入繁出,由 opencc 简繁转换库实现
option_name: zh_trad
opencc_config: s2t.json
# opencc_config: t2s.json # 繁 -> 简【默认】
# opencc_config: t2tw.json # 繁 -> 台湾
# opencc_config: t2hk.json # 繁 -> 香港

1279584
pinyin.zhwiki20220722.dict.yaml Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

31
pinyin_user.dict.yaml Normal file
View File

@ -0,0 +1,31 @@
# encoding: utf-8
# Rime dictionary
---
name: pinyin_user
version: "2024.02.25"
sort: original
columns:
- text
- code
- weight
...
Rime rime 7
中州韵 rime 6
https://rime.im/ rime 5
小狼毫 rime 4
weasel rime 3
鼠须管 rime 2
squirrel rime 1
git git 1
github.com github 2
github github 1
lishouzhong.com lsz 3
lishouzhong lsz 2
李守中 lsz 1
李鼎 liding 999999

174
pinyin_zrm.schema.yaml Normal file
View File

@ -0,0 +1,174 @@
# encoding: utf-8
# Rime schema settings
#
# Original schema author
# Li Ding <ld.sino@outlook.com>
#
# Changelog
#
schema:
schema_id: pinyin_zrm
name: 双拼_自然码
version: "2024.02.25"
author:
- Li Ding <ld.sino@outlook.com>
description: |
双拼自然码方案映射到全拼,无形码。
dependencies:
- stroke # 反查
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
reset: 0
states: [ 半角, 全角 ]
- name: ascii_punct
reset: 0
states: [ 。,, ]
- name: zh_trad
reset: 0
states: [ 简体, 繁体 ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator
- table_translator
- script_translator
- lua_translator@date_time_translator
filters:
- simplifier
- uniquifier
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- erase/^xx$/
- derive/^([jqxy])u$/$1v/
- derive/^([aoe])([ioun])$/$1$1$2/
- xform/^([aoe])(ng)?$/$1$1$2/
- xform/iu$/Q/
- xform/[iu]a$/W/
- xform/[uv]an$/R/
- xform/[uv]e$/T/
- xform/ing$|uai$/Y/
- xform/^sh/U/
- xform/^ch/I/
- xform/^zh/V/
- xform/uo$/O/
- xform/[uv]n$/P/
- xform/i?ong$/S/
- xform/[iu]ang$/D/
- xform/(.)en$/$1F/
- xform/(.)eng$/$1G/
- xform/(.)ang$/$1H/
- xform/ian$/M/
- xform/(.)an$/$1J/
- xform/iao$/C/
- xform/(.)ao$/$1K/
- xform/(.)ai$/$1L/
- xform/(.)ei$/$1Z/
- xform/ie$/X/
- xform/ui$/V/
- xform/(.)ou$/$1B/
- xform/in$/N/
- xlit/QWRTYUIOPSDFGHMJCKLZXVBN/qwrtyuiopsdfghmjcklzxvbn/
#- abbrev/^(.).+$/$1/
translator:
dictionary: pinyin # search on <dictionary>.dict.yaml file
prism: pinyin_zrm # 此翻译器生成的 prism 文件的文件名,避免和其他方案的 prism 文件重名
enable_charset_filter: true # 使用字符集过滤
encode_commit_history: false # 对已上屏的词自动成词
enable_encoder: false # 使用自动造词,允许新词进入用户词典
enable_sentence: false # 使用自动造句
enable_user_dict: false # 是否生成 .userdb 用户词典。用户词典记录动态字词频,用户词。
# max_phrase_length: 4 # 最大自动成词的词长,开启用户词典后生效
preedit_format:
- xform/([bpmnljqxy])n/$1in/
- xform/(\w)g/$1eng/
- xform/(\w)q/$1iu/
- xform/([gkhvuirzcs])w/$1ua/
- xform/(\w)w/$1ia/
- xform/([dtnlgkhjqxyvuirzcs])r/$1uan/
- xform/(\w)t/$1ve/
- xform/([gkhvuirzcs])y/$1uai/
- xform/(\w)y/$1ing/
- xform/([dtnlgkhvuirzcs])o/$1uo/
- xform/(\w)p/$1un/
- xform/([jqx])s/$1iong/
- xform/(\w)s/$1ong/
- xform/([jqxnl])d/$1iang/
- xform/(\w)d/$1uang/
- xform/(\w)f/$1en/
- xform/(\w)h/$1ang/
- xform/(\w)j/$1an/
- xform/(\w)k/$1ao/
- xform/(\w)l/$1ai/
- xform/(\w)z/$1ei/
- xform/(\w)x/$1ie/
- xform/(\w)c/$1iao/
- xform/([dtgkhvuirzcs])v/$1ui/
- xform/(\w)b/$1ou/
- xform/(\w)m/$1ian/
- xform/([aoe])\1(\w)/$1$2/
- "xform/(^|[ '])v/$1zh/"
- "xform/(^|[ '])i/$1ch/"
- "xform/(^|[ '])u/$1sh/"
- xform/([jqxy])v/$1u/
- xform/([nl])v/$1ü/
reverse_lookup:
dictionary: stroke
enable_completion: true
prefix: "`"
suffix: "'"
tips: (笔画)
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format:
- xform/([nl])v/$1ü/
punctuator:
full_shape:
__include: punctuation:/full_shape
half_shape:
__include: punctuation:/half_shape
symbols:
__include: symbols:/symbols
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
punct: "^/([0-9]+[a-z]*|[a-z]+)$" # symbol 用的
reverse_lookup: "`[a-z]*'?$" # 笔画反查用的
simplifier:
# 简入繁出,由 opencc 简繁转换库实现
option_name: zh_trad
opencc_config: s2t.json
# opencc_config: t2s.json # 繁 -> 简【默认】
# opencc_config: t2tw.json # 繁 -> 台湾
# opencc_config: t2hk.json # 繁 -> 香港

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -1,4 +0,0 @@
User-agent: *
Allow: /
Sitemap: https://lishouzhong.com/sitemap-index.xml

71
punctuation.yaml Normal file
View File

@ -0,0 +1,71 @@
# Rime's punctuation and symbols
# encoding: utf-8
full_shape:
' ' : { commit: ' ' }
',' : { commit: }
'.' : { commit: 。 }
'<' : [ 《, 〈, «, ]
'>' : [ 》, 〉, », ]
'/' : [ ]
'?' : { commit: }
';' : { commit: }
':' : { commit: }
'''' : { pair: [ '', '' ] }
'"' : { pair: [ '“', '”' ] }
'\' : [ 、, ]
'|' : [ ・, ]
'`' : { commit: '`' }
'~' : [ , ˜ ]
'!' : { commit: }
'@' : { commit: }
'#' : { commit: }
'%' : { commit: }
'$' : { commit: '$' }
'^' : { commit: …… }
'&' : { commit: }
'*' : { commit: }
'(' : { commit: }
')' : { commit: }
'-' : { commit: }
'_' : { commit: —— }
'+' : { commit: }
'=' : { commit: }
'[' : [ 「, 【, , ]
']' : [ 」, 】, , ]
'{' : [ 『, 〖, ]
'}' : [ 』, 〗, ]
half_shape:
',' : { commit: }
'.' : { commit: 。 }
'<' : [ 《, 〈, «, ]
'>' : [ 》, 〉, », ]
'/' : [ '/' ]
'?' : { commit: }
';' : { commit: }
':' : { commit: }
'''' : { pair: [ '', '' ] }
'"' : { pair: [ '“', '”' ] }
'\' : [ 、, '\' ]
'|' : [ '|', · ]
'`' : { commit: '`' }
'~' : { commit: '~' }
'!' : { commit: }
'@' : { commit: '@' }
'#' : { commit: '#' }
'%' : { commit: '%' }
'$' : { commit: '$' }
'^' : { commit: …… }
'&' : { commit: '&' }
'*' : [ '*', · ]
'(' : [ ]
')' : [ ]
'-' : { commit: '-' }
'_' : { commit: —— }
'+' : { commit: '+' }
'=' : { commit: '=' }
'[' : [ 「, 【, , ]
']' : [ 」, 】, , ]
'{' : [ 『, 〖, ]
'}' : [ 』, 〗, ]

2
rime.lua Normal file
View File

@ -0,0 +1,2 @@
-- input date time
date_time_translator = require("date_time_translator")

View File

@ -1,26 +0,0 @@
#!/usr/bin/env sh
# cron
# 0 4 * * * . /etc/profile; /bin/sh /opt/ld-site/script/build_on_linux.sh >/dev/null 2>&1
export PATH=$PATH:/opt/dev_tools/node-v20.12.2-linux-x64/bin
script_path="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
original_article_home="/home/ld/Documents/ld_article"
original_article_destination="/opt/ld-site/src/content"
ld_site_dist_target="/opt/nginx_targets/ld_site_dist"
rsync -a --delete-after -f"P config.ts" \
"${original_article_home}/" \
"${original_article_destination}/"
cd "${script_path}/../"
npm run build
if [ $? -ne 0 ]; then
echo "cannot build ld_site."
exit 1
fi
mv ${ld_site_dist_target} "${ld_site_dist_target}-old"
mv dist ${ld_site_dist_target}
rm -rf "${ld_site_dist_target}-old"

View File

@ -1,29 +0,0 @@
---
---
<div class="footer">
<hr />
<div>
<small class="contact">Contact: lsz.sino@outlook.com</small>
&nbsp;&nbsp;
</div>
<div>
<small class="licence">若正文中无特殊说明,本站内容遵循:</small>
<small class="licence">
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/">
署名-非商业使用-相同方式共享 4.0 国际许可
</a>
</small>
</div>
</div>
<style>
.footer {
margin-top: auto;
margin-bottom: 6px;
}
.contact,
.licence {
display: inline-block;
}
</style>

View File

@ -1,13 +0,0 @@
---
interface Props {
title: string;
}
const { title } = Astro.props;
---
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<meta name="generator" content={Astro.generator} />
<link rel="sitemap" href="/sitemap-index.xml" />
<title>{title}</title>

View File

@ -1,39 +0,0 @@
---
---
<div class="nav" id="nav">
<div class="global-nav">
<span class="site-title"><a class="nav-link" href="/">李守中</a></span>
<span class="category-item">
<a class="nav-link" href="/article/blog/">博客</a>
</span>
<span class="category-item">
<a class="nav-link" href="/article/note/">笔记</a>
</span>
<span class="category-item">
<a class="nav-link" href="/article/translation/">翻译</a>
</span>
<span class="category-item">
<a class="nav-link" href="/tool/">工具</a>
</span>
</div>
</div>
<style>
.nav {
margin: 0.2em 0 0 0;
}
.site-title {
font-size: 1.8em;
margin: 0 10px 0 0;
}
.category-item {
margin: 0 10px 0 0;
}
.global-nav:last-child {
margin: 0;
}
.nav-link {
color: black;
}
</style>

View File

@ -1,33 +0,0 @@
---
import type { CollectionEntry, CollectionKey } from "astro:content";
interface Props {
collectionName: CollectionKey;
categoryName: string;
posts: Array<CollectionEntry<CollectionKey>>;
}
const { collectionName, categoryName, posts } = Astro.props;
---
<h1>{categoryName}</h1>
<ul>
{
posts.map((post) => (
<li>
<a href={`/article/${collectionName}/${post.slug}`} target="_blank">
{post.data.title}
</a>
</li>
))
}
</ul>
<style>
ul {
padding: 0;
list-style-type: none;
}
h1 {
margin: 0.5em 0 0 0;
}
</style>

View File

@ -1,110 +0,0 @@
---
import type { CollectionEntry, ContentEntryMap } from "astro:content";
import { getCollection, type CollectionKey } from "astro:content";
import CategorySummary from "./CategorySummary.astro";
import * as pinyinpro from "pinyin-pro";
interface Props {
collectionName: CollectionKey;
sortByTimeline: boolean;
sortByArticleTitle: boolean;
}
const { collectionName, sortByTimeline, sortByArticleTitle } = Astro.props;
type CategoriedPosts = {
[categoryName: string]: Array<CollectionEntry<CollectionKey>>;
};
const allPosts: CollectionEntry<CollectionKey>[] =
await getCollection(collectionName);
const allCategories: Array<string> = Array.from(
new Set(
allPosts.map((entry) => {
return entry.data.category;
})
)
);
const categoriedPostList: Array<CategoriedPosts> = allCategories.map((key) => {
let object: CategoriedPosts = {};
object[key] = allPosts.filter((post) => post.data.category === key);
// article sort function by article title
function sortPostByTitlePinyin(
postA: CollectionEntry<CollectionKey>,
postB: CollectionEntry<CollectionKey>
): number {
let postATitle = pinyinpro.convert(pinyinpro.pinyin(postA.data.title), {
format: "symbolToNum",
});
let postBTitle = pinyinpro.convert(pinyinpro.pinyin(postB.data.title), {
format: "symbolToNum",
});
return postATitle.localeCompare(postBTitle, "en");
}
if (sortByTimeline) {
// sort article by update date
object[key].sort((postA, postB) => {
// if two articles is updated on the same day, sort them by title
if (postA.data.lastUpdate !== postB.data.lastUpdate) {
return postA.data.lastUpdate < postB.data.lastUpdate ? 1 : -1;
}
return sortPostByTitlePinyin(postA, postB);
});
} else if (sortByArticleTitle) {
// sort article by title
// get articles with titles started in Chinese or the alphabet
let postWithAlphabetStartedTitle: CollectionEntry<keyof ContentEntryMap>[] =
object[key].filter((post) => /^[a-zA-Z]/.test(post.data.title));
let postWithChineseStartedTitle: CollectionEntry<keyof ContentEntryMap>[] =
object[key].filter((post) => /^[^a-zA-Z]/.test(post.data.title));
// sort two Array by article title
postWithAlphabetStartedTitle.sort((postA, postB) =>
sortPostByTitlePinyin(postA, postB)
);
postWithChineseStartedTitle.sort((postA, postB) =>
sortPostByTitlePinyin(postA, postB)
);
// articles that have title start with Chinese prior to
// those which have titles start with the alphabet
object[key] = postWithChineseStartedTitle.concat(
postWithAlphabetStartedTitle
);
}
return object;
});
const categoriedPostListSortedByArticleAmount: Array<CategoriedPosts> =
JSON.parse(JSON.stringify(categoriedPostList)).sort(
(a: CategoriedPosts, b: CategoriedPosts) => {
const aKey: string = Object.keys(a)[0];
const bKey: string = Object.keys(b)[0];
return b[bKey].length - a[aKey].length;
}
);
---
<div class="collection-desc">
{
categoriedPostListSortedByArticleAmount.map((obj) => (
<div class="collection-desc-item">
<CategorySummary
collectionName={collectionName}
categoryName={Object.keys(obj)[0]}
posts={obj[Object.keys(obj)[0]]}
/>
</div>
))
}
</div>
<style>
.collection-desc::after {
display: block;
content: "";
clear: both;
}
</style>

View File

@ -1,44 +0,0 @@
---
// get rendered ArticleBodyContent HTML
const html = await Astro.slots.render("default");
// rule:
// 1. If a line belongs to the area where the line break should be kept.
// 2. If a line ends with [a-zA-Z] add a space to the end of the line.
// 3. If a line does not start in ASCII chars, join it to the previous line.
// This is important in using one newline character to wrap Chinese.
const arr = html.split("\n");
let articleHTMLFinal = arr[0];
let remainIntactArea = false;
for (let i = 1; i < arr.length; i++) {
// The first line of the HTML string is a table-of-content head recognized by
// remark-toc so it can be ignored.
if (arr[i].charAt(arr[i].length - 1).match(/[a-zA-Z]/) !== null) {
arr[i] += " ";
}
// Check if the current line belongs to some block area.
if (arr[i].match(/^(<pre|<code|<blockquote|<table)/) !== null) {
remainIntactArea = true;
} else {
remainIntactArea = false;
}
if (
// (
// If the first character is not ascii character,
// OR
// the final character of previous line is not ascii character.
// ) AND
// Current line should not belong to area that remains intact.
(arr[i].charAt(0).match(/[ -~]/) === null ||
arr[i - 1].charAt(arr[i - 1].length - 1).match(/[ -~]/) === null) &&
!remainIntactArea
) {
articleHTMLFinal += arr[i];
} else {
articleHTMLFinal += "\n";
articleHTMLFinal += arr[i];
}
}
---
<Fragment set:html={articleHTMLFinal} />

View File

@ -1,86 +0,0 @@
---
import { getEntry, type CollectionKey } from "astro:content";
interface Props {
articleSlug: string;
collectionName: CollectionKey;
}
const { articleSlug, collectionName } = Astro.props;
const article = await getEntry(collectionName, articleSlug);
const { Content } = await article!.render();
const articlePrettyName = article!.id.split("/").pop()!.replace(".md", "");
---
<div class="article">
<div class="article-title">
<h1>{articlePrettyName}&nbsp;</h1>
{
article!.data.lastUpdate && (
<span class="last-update">Last Update: {article!.data.lastUpdate}</span>
)
}
</div>
<Content />
</div>
<style>
:global(.article img) {
max-width: 100%;
margin: auto;
display: block;
}
:global(.article p) {
margin: 1em 0 1em 0;
}
:global(.article > h1, h2, h3, h4, h5) {
margin: 1em 0 1em 0;
}
:global(.article-title h1) {
margin: 0.5em 0 0 0;
}
.article .article-title {
display: flex;
align-items: baseline;
flex-wrap: wrap;
}
/* reduce indent of TOC list */
:global(.article-title ~ ul:nth-of-type(1)) {
margin: 1em 0 1em 0;
padding: 0 0 0 20px;
}
/* hide TOC headint */
:global(.article-title ~ h2:nth-of-type(1)) {
display: none;
}
/* font for all code */
:global(.article code) {
font-family: "Consolas", "Tahoma", sans-serif;
}
/* code block */
:global(.article pre) {
border: 1px solid #eee;
border-left: 6px solid #ccc;
padding: 6px 6px 4px 6px;
border-radius: 6px;
}
/* inline code in paragraph*/
:global(.article p code) {
color: #be4750;
}
/* inline code in list item */
:global(.article li > code) {
color: #be4750;
}
:global(.article table) {
margin: 1em 0;
}
:global(.article blockquote) {
margin: 0;
padding: 0 1em;
background: rgb(246, 246, 246);
border-radius: 6px;
border: 1px solid #aaa;
overflow-x: auto;
}
</style>

View File

@ -1,18 +0,0 @@
---
import type { CollectionKey } from "astro:content";
import ArticleBody from "./ArticleBody.astro";
import ArticleBodyContent from "./ArticleBodyContent.astro";
interface Props {
articleSlug: string;
collectionName: CollectionKey;
}
const { articleSlug, collectionName } = Astro.props;
---
<ArticleBody>
<ArticleBodyContent
collectionName={collectionName}
articleSlug={articleSlug}
/>
</ArticleBody>

View File

@ -1,19 +0,0 @@
---
---
<ul class="tool-list">
<li class="tool-item"><a href="/tool/unit_conversion">单位换算</a></li>
</ul>
<style>
.tool-list {
list-style: none;
padding: 0;
margin: 0.5em 0;
}
.tool-list li {
float: left;
margin: 0 16px 0 0;
}
</style>

View File

@ -1,229 +0,0 @@
<script setup>
import { computed, ref } from 'vue';
import BigNumber from "bignumber.js";
/**
* @typedef {string} UnitNameStr
*/
/**
* @enum {UnitNameStr}
*/
const UnitName = Object.freeze({
KBYTE: "unit-k-byte",
MBYTE: "unit-m-byte",
GBYTE: "unit-g-byte",
TBYTE: "unit-t-byte",
KIBYTE: "unit-ki-byte",
MIBYTE: "unit-mi-byte",
GIBYTE: "unit-gi-byte",
TIBYTE: "unit-ti-byte",
BYTE: "unit-byte",
BIT: "unit-bit",
KBIT: "unit-k-bit",
MBIT: "unit-m-bit",
GBIT: "unit-g-bit",
TBIT: "unit-t-bit",
})
/**
* @enum {number}
*/
const UnitNameToSize = Object.freeze({
[UnitName.KBYTE]: 1000,
[UnitName.MBYTE]: 1000 * 1000,
[UnitName.GBYTE]: 1000 * 1000 * 1000,
[UnitName.TBYTE]: 1000 * 1000 * 1000 * 1000,
[UnitName.KIBYTE]: 1024,
[UnitName.MIBYTE]: 1024 * 1024,
[UnitName.GIBYTE]: 1024 * 1024 * 1024,
[UnitName.TIBYTE]: 1024 * 1024 * 1024 * 1024,
[UnitName.BYTE]: 1,
[UnitName.BIT]: 1 / 8,
[UnitName.KBIT]: 1000 / 8,
[UnitName.MBIT]: 1000000 / 8,
[UnitName.GBIT]: 1000000000 / 8,
[UnitName.TBIT]: 1000000000000 / 8,
});
const size = ref({
[UnitName.KBYTE]: '',
[UnitName.MBYTE]: '',
[UnitName.GBYTE]: '',
[UnitName.TBYTE]: '',
[UnitName.KIBYTE]: '',
[UnitName.MIBYTE]: '',
[UnitName.GIBYTE]: '',
[UnitName.TIBYTE]: '',
[UnitName.BYTE]: '',
[UnitName.BIT]: '',
[UnitName.KBIT]: '',
[UnitName.MBIT]: '',
[UnitName.GBIT]: '',
[UnitName.TBIT]: '',
});
/**
* Change ref variable when user inputs some characters.
* @param {UnitNameStr} unitName
* @returns {void}
*/
function sizeChanged(unitName) {
/**
* @type {object.<UnitNameStr, string>}
*/
let result = {};
// assign 0 to current input if nothing is passed
if (size.value[unitName].length === 0) result[unitName] = '0';
let inputedBytes = new BigNumber(UnitNameToSize[unitName]).multipliedBy(size.value[unitName]);
for (const key in UnitNameToSize) {
result[key] = inputedBytes.div(UnitNameToSize[key]).toString();
}
result[unitName] = size.value[unitName];
for (const key in UnitNameToSize) {
if (result[key] !== 'NaN') {
size.value[key] = result[key];
} else if (result[key] === 'NaN') {
size.value[key] = '';
}
}
}
const isMultipleOf4KiB = computed(() => {
let userInput = new BigNumber(size.value[UnitName.KIBYTE]);
if (userInput.toNumber() === 0) return false;
return userInput.mod(4).toNumber() === 0 ? true : false;
})
</script>
<template>
<h1>数据单位换算</h1>
<div class="unit-conversion-computation-area 1000-in-byte">
<p>1000 进制并以 Byte :</p>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.KBYTE" type="text" v-model="size[UnitName.KBYTE]"
@input="sizeChanged(UnitName.KBYTE)">
<span class="unit-name">KB</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.MBYTE" type="text" v-model="size[UnitName.MBYTE]"
@input="sizeChanged(UnitName.MBYTE)">
<span class="unit-name">MB</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.GBYTE" type="text" v-model="size[UnitName.GBYTE]"
@input="sizeChanged(UnitName.GBYTE)">
<span class="unit-name">GB</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.TBYTE" type="text" v-model="size[UnitName.TBYTE]"
@input="sizeChanged(UnitName.TBYTE)">
<span class="unit-name">TB</span>
</div>
</div>
<div class="unit-conversion-computation-area 1024-in-byte">
<p>1024 进制并以 Byte :</p>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.KIBYTE" type="text" v-model="size[UnitName.KIBYTE]"
@input="sizeChanged(UnitName.KIBYTE)">
<span class="unit-name">KiB</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.MIBYTE" type="text" v-model="size[UnitName.MIBYTE]"
@input="sizeChanged(UnitName.MIBYTE)">
<span class="unit-name">MiB</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.GIBYTE" type="text" v-model="size[UnitName.GIBYTE]"
@input="sizeChanged(UnitName.GIBYTE)">
<span class="unit-name">GiB</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.TIBYTE" type="text" v-model="size[UnitName.TIBYTE]"
@input="sizeChanged(UnitName.TIBYTE)">
<span class="unit-name">TiB</span>
</div>
</div>
<div class="unit-conversion-computation-area byte-bit">
<p> Byte (B) / bit (b) :</p>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.BYTE" type="text" v-model="size[UnitName.BYTE]"
@input="sizeChanged(UnitName.BYTE)">
<span class="unit-name">B</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.BIT" type="text" v-model="size[UnitName.BIT]"
@input="sizeChanged(UnitName.BIT)">
<span class="unit-name">b</span>
</div>
</div>
<div class="unit-conversion-computation-area 1000-in-bit">
<p>1000 进制并以 bit :</p>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.KBIT" type="text" v-model="size[UnitName.KBIT]"
@input="sizeChanged(UnitName.KBIT)">
<span class="unit-name">Kb</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.MBIT" type="text" v-model="size[UnitName.MBIT]"
@input="sizeChanged(UnitName.MBIT)">
<span class="unit-name">Mb</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.GBIT" type="text" v-model="size[UnitName.GBIT]"
@input="sizeChanged(UnitName.GBIT)">
<span class="unit-name">Gb</span>
</div>
<div class="unit-conversion-computation-node">
<input class="size-text" :id="UnitName.TBIT" type="text" v-model="size[UnitName.TBIT]"
@input="sizeChanged(UnitName.TBIT)">
<span class="unit-name">Tb</span>
</div>
</div>
<div class="unit-conversion-computation-result">
<p v-show="isMultipleOf4KiB">该结果值是 4 KiB 的倍数</p>
</div>
</template>
<style>
h1,
p {
margin: 0.5em 0;
}
.unit-conversion-computation-node {
margin: 0.5em 0;
}
.unit-conversion-computation-node {
float: left;
width: 170px;
margin: 0 8px 0 0;
}
.unit-conversion-computation-node .size-text {
margin: 0 6px 0 0;
width: 125px
}
@media screen and (max-width: 395px) {
.unit-conversion-computation-node {
width: 140px;
}
.unit-conversion-computation-node .size-text {
width: 95px;
}
}
.unit-conversion-computation-area::after {
content: '';
display: block;
clear: both;
}
.unit-conversion-computation-result {
margin: 0.5em 0 0.5em 0;
height: 1em;
}
</style>

View File

@ -1,10 +0,0 @@
---
import DataUnitConversion from "./DataUnitConversion.vue";
import WeightUnitConversion from "./WeightUnitConversion.vue";
---
<WeightUnitConversion client:load />
<br>
<DataUnitConversion client:load />

View File

@ -1,150 +0,0 @@
<script setup>
import { computed, ref } from 'vue';
import BigNumber from "bignumber.js";
/**
* @typedef {string} UnitNameStr
*/
/**
* @enum {UnitNameStr}
*/
const twToMetricUnitName = Object.freeze({
JIN: "jin",
LIANG: "liang",
QIAN: "qian",
FEN: "fen",
GRAM: "gram",
KILOGRAM: "kilogram"
})
/**
* @enum {number}
*/
const twToMetricUnitNameToWeight = Object.freeze({
[twToMetricUnitName.JIN]: 600,
[twToMetricUnitName.LIANG]: 600 / 16,
[twToMetricUnitName.QIAN]: 600 / 16 / 10,
[twToMetricUnitName.FEN]: 600 / 16 / 10 / 10,
[twToMetricUnitName.GRAM]: 1,
[twToMetricUnitName.KILOGRAM]: 1 * 1000,
})
const weight = ref({
[twToMetricUnitName.JIN]: '',
[twToMetricUnitName.LIANG]: '',
[twToMetricUnitName.QIAN]: '',
[twToMetricUnitName.FEN]: '',
[twToMetricUnitName.GRAM]: '',
[twToMetricUnitName.KILOGRAM]: '',
});
/**
* Change ref variable when user inputs some characters.
* @param {UnitNameStr} unitName
* @returns {void}
*/
function weightChanged(unitName) {
/**
* @type {object.<UnitNameStr, string>}
*/
let result = {};
// assign 0 to current input if nothing is passed
if (weight.value[unitName].length === 0) result[unitName] = '0';
let inputedGram = new BigNumber(twToMetricUnitNameToWeight[unitName]).multipliedBy(weight.value[unitName]);
for (const key in twToMetricUnitNameToWeight) {
result[key] = inputedGram.div(twToMetricUnitNameToWeight[key]).toString();
}
result[unitName] = weight.value[unitName];
for (const key in twToMetricUnitNameToWeight) {
if (result[key] !== 'NaN') {
weight.value[key] = result[key];
} else if (result[key] === 'NaN') {
weight.value[key] = '';
}
}
}
</script>
<template>
<h1>重量换算</h1>
<div class="weight-conversion-computation-area metric">
<p>公制重量:</p>
<div class="weight-conversion-computation-node">
<input class="size-text" :id="twToMetricUnitName.KILOGRAM" type="text"
v-model="weight[twToMetricUnitName.KILOGRAM]" @input="weightChanged(twToMetricUnitName.KILOGRAM)">
<span class="unit-name">千克</span>
</div>
<div class="weight-conversion-computation-node">
<input class="size-text" :id="twToMetricUnitName.GRAM" type="text" v-model="weight[twToMetricUnitName.GRAM]"
@input="weightChanged(twToMetricUnitName.GRAM)">
<span class="unit-name"></span>
</div>
</div>
<div class="weight-conversion-computation-area tw">
<p>台湾制重量:</p>
<div class="weight-conversion-computation-node">
<input class="size-text" :id="twToMetricUnitName.JIN" type="text" v-model="weight[twToMetricUnitName.JIN]"
@input="weightChanged(twToMetricUnitName.JIN)">
<span class="unit-name"></span>
</div>
<div class="weight-conversion-computation-node">
<input class="size-text" :id="twToMetricUnitName.LIANG" type="text" v-model="weight[twToMetricUnitName.LIANG]"
@input="weightChanged(twToMetricUnitName.LIANG)">
<span class="unit-name"></span>
</div>
<div class="weight-conversion-computation-node">
<input class="size-text" :id="twToMetricUnitName.QIAN" type="text" v-model="weight[twToMetricUnitName.QIAN]"
@input="weightChanged(twToMetricUnitName.QIAN)">
<span class="unit-name"></span>
</div>
<div class="weight-conversion-computation-node">
<input class="size-text" :id="twToMetricUnitName.FEN" type="text" v-model="weight[twToMetricUnitName.FEN]"
@input="weightChanged(twToMetricUnitName.FEN)">
<span class="unit-name"></span>
</div>
</div>
</template>
<style>
h1,
p {
margin: 0.5em 0;
}
.weight-conversion-computation-node {
margin: 0.5em 0;
}
.weight-conversion-computation-node {
float: left;
width: 170px;
margin: 0 8px 0 0;
}
.weight-conversion-computation-node .size-text {
margin: 0 6px 0 0;
width: 115px
}
@media screen and (max-width: 395px) {
.weight-conversion-computation-node {
width: 140px;
}
.weight-conversion-computation-node .size-text {
width: 85px;
}
}
.weight-conversion-computation-area::after {
content: '';
display: block;
clear: both;
}
.weight-conversion-computation-result {
margin: 0.5em 0 0.5em 0;
height: 1em;
}
</style>

View File

@ -1,35 +0,0 @@
import { z, defineCollection } from 'astro:content';
const blogCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
category: z.string(),
lastUpdate: z.string()
}),
});
const noteCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
category: z.string(),
lastUpdate: z.string()
}),
});
const translationCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
category: z.string(),
lastUpdate: z.string()
}),
});
export const collections = {
'blog': blogCollection,
'note': noteCollection,
'translation': translationCollection,
};

2
src/env.d.ts vendored
View File

@ -1,2 +0,0 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

View File

@ -1,19 +0,0 @@
---
import HTMLCommonHead from "../components/HTMLCommonHead.astro";
import "../styles/global.css"
interface Props {
title: string;
}
const { title } = Astro.props;
---
<!doctype html>
<html lang="zh">
<head>
<HTMLCommonHead title={title}/>
</head>
<body>
<slot />
</body>
</html>

View File

@ -1,12 +0,0 @@
---
import DefaultLayout from "../layouts/DefaultLayout.astro";
import Nav from "../components/Nav.astro";
import Footer from "../components/Footer.astro";
import ArticleBodyWrapper from "../components/article/article_body/ArticleBodyWrapper.astro";
---
<DefaultLayout title="404">
<Nav />
<ArticleBodyWrapper collectionName="site" articleSlug="404" />
<Footer />
</DefaultLayout>

View File

@ -1,34 +0,0 @@
---
import { getCollection } from "astro:content";
import type {
CollectionEntry,
CollectionKey,
ContentEntryMap,
} from "astro:content";
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import ArticleBodyWrapper from "../../../components/article/article_body/ArticleBodyWrapper.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
export async function getStaticPaths() {
const collectionName: CollectionKey = "blog";
const blogEntries = await getCollection(collectionName);
return blogEntries.map((entry) => ({
params: { blog: entry.slug },
props: { entry },
}));
}
interface Props {
entry: CollectionEntry<keyof ContentEntryMap>;
}
const { entry } = Astro.props;
const articlePrettyName:string = entry.id.split("/").pop()!.replace(".md", "");
---
<DefaultLayout title=`${articlePrettyName} - 李守中`>
<Nav />
<ArticleBodyWrapper collectionName="blog" articleSlug={entry.slug} />
<Footer />
</DefaultLayout>

View File

@ -1,37 +0,0 @@
---
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import CollectionSummary from "../../../components/article/CollectionSummary.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
---
<DefaultLayout title="博客 - 李守中">
<Nav />
<div class="options">
<span>当前: [按日期降序]</span>
<a href="/article/blog/sort_by_name">按名字排序</a>
</div>
<CollectionSummary
collectionName="blog"
sortByTimeline={true}
sortByArticleTitle={false}
/>
<Footer />
</DefaultLayout>
<style>
:global(@media screen and (max-width: 768px)) {
.collection-desc-item {
width: 100%;
}
}
:global(@media screen and (min-width: 768px)) {
.collection-desc-item {
width: 50%;
float: left;
}
}
.options {
margin: 0.5em 0 0 0;
}
</style>

View File

@ -1,37 +0,0 @@
---
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import CollectionSummary from "../../../components/article/CollectionSummary.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
---
<DefaultLayout title="博客 - 李守中">
<Nav />
<div class="options">
<span>当前: [按名字排序]</span>
<a href="/article/blog/">按日期降序</a>
</div>
<CollectionSummary
collectionName="blog"
sortByTimeline={false}
sortByArticleTitle={true}
/>
<Footer />
</DefaultLayout>
<style>
:global(@media screen and (max-width: 768px)) {
.collection-desc-item {
width: 100%;
}
}
:global(@media screen and (min-width: 768px)) {
.collection-desc-item {
width: 50%;
float: left;
}
}
.options {
margin: 0.5em 0 0 0;
}
</style>

View File

@ -1,34 +0,0 @@
---
import { getCollection } from "astro:content";
import type {
CollectionEntry,
CollectionKey,
ContentEntryMap,
} from "astro:content";
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import ArticleBodyWrapper from "../../../components/article/article_body/ArticleBodyWrapper.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
export async function getStaticPaths() {
const collectionName: CollectionKey = "note";
const blogEntries = await getCollection(collectionName);
return blogEntries.map((entry) => ({
params: { note: entry.slug },
props: { entry },
}));
}
interface Props {
entry: CollectionEntry<keyof ContentEntryMap>;
}
const { entry } = Astro.props;
const articlePrettyName:string = entry.id.split("/").pop()!.replace(".md", "");
---
<DefaultLayout title=`${articlePrettyName} - 李守中`>
<Nav />
<ArticleBodyWrapper collectionName="note" articleSlug={entry.slug} />
<Footer />
</DefaultLayout>

View File

@ -1,37 +0,0 @@
---
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import CollectionSummary from "../../../components/article/CollectionSummary.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
---
<DefaultLayout title="笔记 - 李守中">
<Nav />
<div class="options">
<span>当前: [按名字排序]</span>
<a href="/article/note/sort_by_timeline">按日期降序</a>
</div>
<CollectionSummary
collectionName="note"
sortByTimeline={false}
sortByArticleTitle={true}
/>
<Footer />
</DefaultLayout>
<style>
:global(@media screen and (max-width: 768px)) {
.collection-desc-item {
width: 100%;
}
}
:global(@media screen and (min-width: 768px)) {
.collection-desc-item {
width: 50%;
float: left;
}
}
.options {
margin: 0.5em 0 0 0;
}
</style>

View File

@ -1,37 +0,0 @@
---
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import CollectionSummary from "../../../components/article/CollectionSummary.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
---
<DefaultLayout title="笔记 - 李守中">
<Nav />
<div class="options">
<span>当前: [按日期降序]</span>
<a href="/article/note/">按名字排序</a>
</div>
<CollectionSummary
collectionName="note"
sortByTimeline={true}
sortByArticleTitle={false}
/>
<Footer />
</DefaultLayout>
<style>
:global(@media screen and (max-width: 768px)) {
.collection-desc-item {
width: 100%;
}
}
:global(@media screen and (min-width: 768px)) {
.collection-desc-item {
width: 50%;
float: left;
}
}
.options {
margin: 0.5em 0 0 0;
}
</style>

View File

@ -1,34 +0,0 @@
---
import { getCollection } from "astro:content";
import type {
CollectionEntry,
CollectionKey,
ContentEntryMap,
} from "astro:content";
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import ArticleBodyWrapper from "../../../components/article/article_body/ArticleBodyWrapper.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
export async function getStaticPaths() {
const collectionName: CollectionKey = "translation";
const blogEntries = await getCollection(collectionName);
return blogEntries.map((entry) => ({
params: { translation: entry.slug },
props: { entry },
}));
}
interface Props {
entry: CollectionEntry<keyof ContentEntryMap>;
}
const { entry } = Astro.props;
const articlePrettyName:string = entry.id.split("/").pop()!.replace(".md", "");
---
<DefaultLayout title=`${articlePrettyName} - 李守中`>
<Nav />
<ArticleBodyWrapper collectionName="translation" articleSlug={entry.slug} />
<Footer />
</DefaultLayout>

View File

@ -1,37 +0,0 @@
---
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import CollectionSummary from "../../../components/article/CollectionSummary.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
---
<DefaultLayout title="翻译 - 李守中">
<Nav />
<div class="options">
<span>当前: [按名字排序]</span>
<a href="/article/translation/sort_by_timeline">按日期降序</a>
</div>
<CollectionSummary
collectionName="translation"
sortByTimeline={false}
sortByArticleTitle={true}
/>
<Footer />
</DefaultLayout>
<style>
:global(@media screen and (max-width: 1024px)) {
.collection-desc-item {
width: 100%;
}
}
:global(@media screen and (min-width: 1024px)) {
.collection-desc-item {
width: 50%;
float: left;
}
}
.options {
margin: 0.5em 0 0 0;
}
</style>

View File

@ -1,37 +0,0 @@
---
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import CollectionSummary from "../../../components/article/CollectionSummary.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
---
<DefaultLayout title="翻译 - 李守中">
<Nav />
<div class="options">
<span>当前: [按日期降序]</span>
<a href="/article/translation/">按名字排序</a>
</div>
<CollectionSummary
collectionName="translation"
sortByTimeline={true}
sortByArticleTitle={false}
/>
<Footer />
</DefaultLayout>
<style>
:global(@media screen and (max-width: 1024px)) {
.collection-desc-item {
width: 100%;
}
}
:global(@media screen and (min-width: 1024px)) {
.collection-desc-item {
width: 50%;
float: left;
}
}
.options {
margin: 0.5em 0 0 0;
}
</style>

View File

@ -1,12 +0,0 @@
---
import DefaultLayout from "../layouts/DefaultLayout.astro";
import Nav from "../components/Nav.astro";
import Footer from "../components/Footer.astro";
import ArticleBodyWrapper from "../components/article/article_body/ArticleBodyWrapper.astro";
---
<DefaultLayout title="李守中">
<Nav />
<ArticleBodyWrapper collectionName="site" articleSlug="关于本站" />
<Footer />
</DefaultLayout>

View File

@ -1,14 +0,0 @@
---
import DefaultLayout from "../../layouts/DefaultLayout.astro";
import Footer from "../../components/Footer.astro";
import Nav from "../../components/Nav.astro";
import UnitConversionWrapper from "../../components/tool/unit_conversion/UnitConversionWrapper.astro";
import ToolNav from "../../components/tool/ToolNav.astro";
---
<DefaultLayout title="工具 - 李守中">
<Nav />
<ToolNav />
<UnitConversionWrapper />
<Footer />
</DefaultLayout>

View File

@ -1,14 +0,0 @@
---
import DefaultLayout from "../../layouts/DefaultLayout.astro";
import Footer from "../../components/Footer.astro";
import Nav from "../../components/Nav.astro";
import UnitConversionWrapper from "../../components/tool/unit_conversion/UnitConversionWrapper.astro";
import ToolNav from "../../components/tool/ToolNav.astro";
---
<DefaultLayout title="单位换算 - 李守中">
<Nav />
<ToolNav />
<UnitConversionWrapper />
<Footer />
</DefaultLayout>

View File

@ -1,99 +0,0 @@
@media screen and (max-width: 1024px) {
body {
width: 95%;
}
}
@media screen and (min-width: 1024px) {
body {
width: 954px;
}
}
html {
height: 100%;
}
body {
display: flex;
flex-direction: column;
font-family: "Consolas", "Hack", -apple-system,
BlinkMacSystemFont, Tahoma, Arial, "Hiragino Sans GB", "Microsoft YaHei",
"WenQuanYi Micro Hei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
font-size: 1em;
margin: auto;
overflow-y: scroll;
min-height: 100%;
line-height: 1.5;
}
a {
text-decoration: none;
color: #275d93;
}
a:hover {
text-decoration: underline;
}
hr {
width: 100%;
height: 1px;
background: #ccc;
color: #ccc;
margin: 1em 0;
border: none;
padding: 0;
}
/* table start */
table {
border-collapse: separate;
border-spacing: 0;
width: 100%;
}
table tr th,
table tr td {
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 5px;
}
table tr th:first-child,
table tr td:first-child {
border-left: 1px solid #ccc;
}
table tr th:first-child,
table tr td:first-child {
border-left: 1px solid #ccc;
}
table tr th {
background: #eee;
border-top: solid 1px #ccc;
}
/* top-left border-radius */
table tr:first-child th:first-child {
border-top-left-radius: 6px;
}
/* top-right border-radius */
table tr:first-child th:last-child {
border-top-right-radius: 6px;
}
/* bottom-left border-radius */
table tr:last-child td:first-child {
border-bottom-left-radius: 6px;
}
/* bottom-right border-radius */
table tr:last-child td:last-child {
border-bottom-right-radius: 6px;
}
/* table end */

114977
stroke.dict.yaml Normal file

File diff suppressed because it is too large Load Diff

111
stroke.schema.yaml Normal file
View File

@ -0,0 +1,111 @@
# encoding: utf-8
# Rime schema settings
#
# Original schema author
# Rime 五筆畫 v0.5 作者: 四季的風 雪齋 Kunki Chou
#
# Changelog
# 2022-09-14 Li Ding <ld.sino@outlook.com>
# - turn off word creation related functions and dynamic user dict
#
schema:
schema_id: stroke
name: "笔画"
version: "2022-09-14"
author:
- 四季的風
- 雪齋
- Kunki Chou
- Li Ding <ld.sino@outlook.com>
description: |
笔画
h,s,p,n,z 代表横、竖、撇、捺、折
由 Rime 五筆畫 v0.5 修改而来
dependencies:
- pinyin
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
reset: 0
states: [ 半角, 全角 ]
- name: ascii_punct
reset: 0
states: [ 。,, ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator
- table_translator
speller:
alphabet: "abcdefghijklmnopqrstuvwxyz"
delimiter: " '"
menu:
page_size: 9
translator:
dictionary: stroke # search on <dictionary>.dict.yaml file
enable_charset_filter: true # 使用字符集过滤
encode_commit_history: false # 对已上屏的词自动成词
enable_encoder: false # 使用自动造词,允许新词进入用户词典
enable_sentence: false # 使用自动造句
enable_user_dict: false # 是否生成 .userdb 用户词典。用户词典记录动态字词频,用户词。
# max_phrase_length: 4 # 最大自动成词的词长,开启用户词典后生效
preedit_format:
- xlit/hspnz/一丨丿丶乙/
comment_format:
- xform/~//
- xlit/hspnz/一丨丿丶乙/
abc_segmentor:
extra_tags:
- reverse_lookup
reverse_lookup:
dictionary: pinyin
prefix: "`"
suffix: "'"
tips: 〔拼音〕
preedit_format:
- xform/([nl])v/$1ü/
- xform/([nl])ue/$1üe/
- xform/([jqxy])v/$1u/
comment_format:
- xlit/hspnz/一丨丿丶乙/
punctuator:
full_shape:
__include: punctuation:/full_shape
half_shape:
__include: punctuation:/half_shape
symbols:
__include: symbols:/symbols
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
reverse_lookup: "`[a-z]*'?$"

16
symbols.yaml Normal file
View File

@ -0,0 +1,16 @@
# Rime's punctuation and symbols
# encoding: utf-8
symbols:
"/r": [ " -> " ]
"/l": [ " <- " ]
# 八卦、八卦名
'/bg': [ ☰, ☱, ☲, ☳, ☴, ☵, ☶, ☷ ]
'/bgm': [ 乾, 兌, 離, 震, 巽, 坎, 艮, 坤 ]
# 罗马数字
'/lm': [ , ⅱ, ⅲ, ⅳ, , ⅵ, ⅶ, ⅷ, ⅸ, , ⅺ, ⅻ, , , , ⅿ ]
'/lmu': [ , Ⅱ, Ⅲ, Ⅳ, , Ⅵ, Ⅶ, Ⅷ, Ⅸ, , Ⅺ, Ⅻ, , , , ]
# 天干、地支、干支
'/tg': [ 甲, 乙, 丙, 丁, 戊, 己, 庚, 辛, 壬, 癸 ]
'/dz': [ 子, 丑, 寅, 卯, 辰, 巳, 午, 未, 申, 酉, 戌, 亥 ]
'/gz': [ 甲子, 乙丑, 丙寅, 丁卯, 戊辰, 己巳, 庚午, 辛未, 壬申, 癸酉, 甲戌, 乙亥, 丙子, 丁丑, 戊寅, 己卯, 庚辰, 辛巳, 壬午, 癸未, 甲申, 乙酉, 丙戌, 丁亥, 戊子, 己丑, 庚寅, 辛卯, 壬辰, 癸巳, 甲午, 乙未, 丙申, 丁酉, 戊戌, 己亥, 庚子, 辛丑, 壬寅, 癸卯, 甲辰, 乙巳, 丙午, 丁未, 戊申, 己酉, 庚戌, 辛亥, 壬子, 癸丑, 甲寅, 乙卯, 丙辰, 丁巳, 戊午, 己未, 庚申, 辛酉, 壬戌, 癸亥 ]

View File

@ -1,6 +0,0 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"jsx": "preserve"
}
}

73
weasel.yaml Normal file
View File

@ -0,0 +1,73 @@
# Weasel settings
# encoding: utf-8
config_version: "0.22"
app_options:
cmd.exe:
ascii_mode: true
conhost.exe:
ascii_mode: true
style:
color_scheme: cool_breeze
font_face: "Microsoft YaHei"
font_point: 14
label_font_point: 11
label_format: "%s."
mark_text: ""
# horizontal: true # 横向排列候选
inline_preedit: true # 隐藏打字栏
fullscreen: false
preedit_type: composition
display_tray_icon: false # 显示托盘图标
vertical_auto_reverse: false
vertical_text: false
vertical_text_left_to_right: false
vertical_text_with_wrap: false
layout:
enhanced_position: true # 获取光标位置失败后在窗口左上角绘制输入框
align_type: center
max_width: 0
min_width: 0
min_height: 0
max_height: 0
border_width: 1 # 边框宽度
margin_x: 8 # 候选字左右边距
margin_y: 8 # 候选字上下边距
candidate_spacing: 8 # 候选字间隔,小于等于 margin 时,其值等于 margin 的值
hilite_spacing: 2 # 标签和候选字的间隔
hilite_padding: 4 # 候选字背景色块的额外高度
spacing: 10 # 打字栏与候选栏的间距
corner_radius: 2 # 候选栏圆角幅度
# hilited_corner_radius: 2 # 候选字背景色块圆角幅度
round_corner: 2 # 是 hilited_corner_radius 的别名
shadow_radius: 0
shadow_offset_x: 4
shadow_offset_y: 4
preset_color_schemes:
tantsing:
name: "丹青Tantsing"
author: Mijiag
text_color: 0x000000
back_color: 0xE3E3E3
border_color: 0x000000
candidate_text_color: 0x000000
comment_text_color: 0x474747
hilited_back_color: 0x1A0791
hilited_candidate_back_color: 0x6F0B73
hilited_candidate_text_color: 0xE3E3E3
hilited_text_color: 0xE3E3E3
cool_breeze:
name: "清風Cool Breeze"
author: "skoj <skoj@qq.com>"
text_color: 0x0000FF
back_color: 0xFFFBFB
border_color: 0xFFAAAA
hilited_text_color: 0x0000CE
hilited_back_color: 0xFFFBFB
candidate_text_color: 0x009100
hilited_candidate_text_color: 0x6F003A
hilited_candidate_back_color: 0xFFD6AC

37
wubi_86.dict.yaml Normal file
View File

@ -0,0 +1,37 @@
# encoding: utf-8
# Rime dictionary
#
# Original table author
# Li Ding <ld.sino@outlook.com>
#
# Changelog
#
# 2022-09-14 Li Ding <ld.sino@outlook.com>
# - export MS wubi_86 code table with wubi-lex, only keep single words
#
# 2024.02.25 Li Ding <ld.sino@outlook.com>
# - add phrases from jishuang 4.3
# - reorganize dict structure
#
---
name: wubi_86
version: "2024.02.25"
import_tables:
- wubi_86_win10_single
- wubi_86_jishuang_phrase
- wubi_86_district
- wubi_86_user
encoder:
# 以 z 开头的输入不走这个码表 ( 走拼音反查 )
exclude_patterns:
- '^z.*$'
# rules 部分对于单字输入没什么用
# rules:
# - length_equal: 2 # 对于 2 字词
# formula: "AaAbBaBb" # 取第一字首尾码、第二字首尾碼
# - length_equal: 3 # 对于 3 字词
# formula: "AaBaCaCb" # 取第一字首尾码、第三字首尾碼
# - length_in_range: [4, 10] # 对于 4 - 10 个字的词
# formula: "AaBaCaZa" # 取第一字首码、第二字首码、第三字首码、最后一字首码
...

110
wubi_86.schema.yaml Normal file
View File

@ -0,0 +1,110 @@
# encoding: utf-8
# Rime schema settings
#
# Changelog
#
schema:
schema_id: wubi_86
name: "五笔_86"
version: "2024.02.25"
author:
- Li Ding <ld.sino@outlook.com>
description: |
五笔86版
王永民先生发明
码表源自微软五笔 (Win10 21H2) 去除词组的部分
敲 z 键进入拼音反查
dependencies:
- pinyin # 反查
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
reset: 0
states: [ 半角, 全角 ]
- name: ascii_punct
reset: 0
states: [ 。,, ]
- name: zh_trad
reset: 0
states: [ 简体, 繁体 ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- express_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- reverse_lookup_translator
- table_translator
- lua_translator@date_time_translator
filters:
- simplifier
- uniquifier
speller:
delimiter: " ;'"
# auto_select: true
max_code_length: 4
translator:
dictionary: wubi_86 # search on <dictionary>.dict.yaml file
enable_charset_filter: true # 使用字符集过滤
encode_commit_history: false # 对已上屏的词自动成词
enable_encoder: false # 使用自动造词,允许新词进入用户词典
enable_sentence: false # 使用自动造句
enable_user_dict: false # 是否生成 .userdb 用户词典。用户词典记录动态字词频,用户词。
# max_phrase_length: 4 # 最大自动成词的词长,开启用户词典后生效
disable_user_dict_for_patterns:
- "^z.*$"
reverse_lookup:
dictionary: pinyin
# prism: pinyin_zrm # 全拼反查。取消注释,反查模式为双拼反查。
prefix: "z"
suffix: "'"
tips: 〔拼音〕
preedit_format:
- xform/([nl])v/$1ü/
- xform/([nl])ue/$1üe/
- xform/([jqxy])v/$1u/
punctuator:
full_shape:
__include: punctuation:/full_shape
half_shape:
__include: punctuation:/half_shape
symbols:
__include: symbols:/symbols
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
punct: '^/([0-9]0?|[A-Za-z]+)$' # symbol 用的
reverse_lookup: "^z[a-z]*'?$" # 笔画反查用的
simplifier:
# 简入繁出,由 opencc 简繁转换库实现
option_name: zh_trad
opencc_config: s2t.json
# opencc_config: t2s.json # 繁 -> 简【默认】
# opencc_config: t2tw.json # 繁 -> 台湾
# opencc_config: t2hk.json # 繁 -> 香港

3591
wubi_86_district.dict.yaml Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

30
wubi_86_user.dict.yaml Normal file
View File

@ -0,0 +1,30 @@
# encoding: utf-8
# Rime dictionary
---
name: wubi_86_user
version: "2024.02.25"
sort: by_weight
columns:
- text
- code
- weight
...
Rime rime 7
中州韵 rime 6
https://rime.im/ rime 5
小狼毫 rime 4
weasel rime 3
鼠须管 rime 2
squirrel rime 1
lishouzhong.com lsz
lishouzhong lsz
git git 1
github.com github 2
github github 1
李守中 spkh

31921
wubi_86_win10_single.dict.yaml Normal file

File diff suppressed because it is too large Load Diff

144
zh_numbers.schema.yaml Normal file
View File

@ -0,0 +1,144 @@
# encoding: utf-8
# Rime schema settings
#
# Original schema author
# Rime 官方教程: 數字之道
#
# Changelog
#
# 2022-09-14 Li Ding <ld.sino@outlook.com>
# - 从教程导出并整理本方案
#
schema:
schema_id: zh_numbers
name: 中文数字
version: "2022-09-14"
description: 快捷输入中文大小写数字
switches:
- name: full_shape
states: [ 壹贰叁, 一二三 ]
reset: 0
engine:
processors:
- key_binder
- punctuator
- selector
- express_editor
segmentors:
- punct_segmentor
translators:
- punct_translator
menu:
# 选择候选词的键,相当于 12345
# 因为这个输入方案中的数字已经用于输入文字了,
# 不能使用12345作为候选词的选择键
alternative_select_keys: "acegi"
punctuator:
half_shape:
# 壹贰叁 模式下
"1":
"2":
"3":
"4":
"5":
"6":
"7":
"8":
"9":
"0":
"s":
"b":
"q":
"w":
"j":
"f":
"n":
"y": [ 元, 月, 亿 ]
"r":
"x": 星期
"z": [ 整, 之 ]
"d":
"h":
".":
# shift + key
"!":
"@":
"#":
"$": [ 四, ¥]
"%": [ 五, 百分之 ]
"^":
"&":
"*":
"(":
")":
"S":
"B":
"Q":
"W":
"J":
"F":
"N":
"Y": [ 元, 月, 亿 ]
"R":
"X": 星期
"Z": [ 整, 之 ]
"D":
"H":
">":
# 一二三 模式下
full_shape:
"1":
"2":
"3":
"4":
"5":
"6":
"7":
"8":
"9":
"0":
"s":
"b":
"q":
"w":
"n":
"y": [ 元, 月, 亿 ]
"r":
"x": 星期
"j":
"f":
"z": [ 整, 之 ]
"d":
"h":
".":
# shift + key
"!":
"@":
"#":
"$": [ 肆, ¥]
"%": [ 伍, 百分之 ]
"^":
"&":
"*":
"(":
")":
"S":
"B":
"Q":
"W":
"J":
"F":
"N":
"Y": [ 元, 月, 亿 ]
"R":
"X": 星期
"Z": [ 整, 之 ]
"D":
"H":
">":