Skip to content

Commit

Permalink
refactor: 改写拼写规则的搭桥字母 (iDvel#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirtlecn authored and lovelock committed Jun 8, 2023
1 parent 8e5e4be commit cc83a1a
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 152 deletions.
53 changes: 26 additions & 27 deletions cn_dicts/others.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,32 @@ version: "2023-04-08"
sort: by_weight
...
##### 大写字母
# 因为默认的双拼拼写规则用掉了大写字母。这些奇怪的编码是为了做 xlit 转写,同时适配全拼和双拼。
A ā
B ḃ
C ç
D ď
E ē
F ḟ
G ḡ
H ĥ
I ī
J ĵ
K ḱ
L ĺ
M ḿ
N ń
O ō
P ṕ
Q ɋ
R ŕ
S ś
T ť
U ū
V ṽ
W ẃ
X ẋ
Y ȳ
Z ź
A A
B B
C C
D D
E E
F F
G G
H H
I I
J J
K K
L L
M M
N N
O O
P P
Q Q
R R
S S
T T
U U
V V
W W
X X
Y Y
Z Z

##### 容错词
# 「血xue、xie」「谁shui、shei」「露lu、lou」「熟shu、shou」「密钥yao、yue」已在 base 中实现
Expand Down
54 changes: 26 additions & 28 deletions double_pinyin.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,32 +237,30 @@ speller:
- 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/
- xform/iu$/ǫ/
- xform/[iu]a$//
- xform/[uv]an$/ʀ/
- xform/[uv]e$//
- xform/ing$|uai$/ʏ/
- xform/^sh//
- xform/^ch/ɪ/
- xform/^zh//
- xform/uo$//
- xform/[uv]n$//
- xform/i?ong$/s/
- xform/[iu]ang$//
- xform/(.)en$/$/
- xform/(.)eng$/$/
- xform/(.)ang$/$/
- xform/ian$//
- xform/(.)an$/$1ᴊ/
- xform/iao$//
- xform/(.)ao$/$1ᴋ/
- xform/(.)ai$/$/
- xform/(.)ei$/$1ᴢ/
- xform/ie$/x/
- xform/ui$//
- xform/(.)ou$/$/
- xform/in$/ɴ/
- xlit/ǫᴡʀᴛʏᴜɪᴏᴘsᴅғɢʜᴍᴊᴄᴋʟᴢxᴠʙɴ/qwrtyuiopsdfghmjcklzxvbn/
- abbrev/^(.).+$/$1/ # 首字母简拼
# 可输入大写字母。因为上面的双拼拼写规则用掉了大写字母。做了 xlit 转写,同时适配全拼和双拼。
- xlit/āḃçďēḟḡĥīĵḱĺḿńōṕɋŕśťūṽẃẋȳź/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
56 changes: 27 additions & 29 deletions double_pinyin_flypy.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# 默认启用的中英混输词库是全拼的,需要在 melt_eng.dict.yaml 中修改为对应的双拼的。


# 方案说明
schema:
schema_id: double_pinyin_flypy
Expand Down Expand Up @@ -237,32 +236,31 @@ speller:
- derive/^([jqxy])u$/$1v/
- derive/^([aoe])([ioun])$/$1$1$2/
- xform/^([aoe])(ng)?$/$1$1$2/
- xform/iu$/Q/
- xform/(.)ei$/$1W/
- xform/uan$/R/
- xform/[uv]e$/T/
- xform/un$/Y/
- xform/^sh/U/
- xform/^ch/I/
- xform/^zh/V/
- xform/uo$/O/
- xform/ie$/P/
- xform/i?ong$/S/
- xform/ing$|uai$/K/
- xform/(.)ai$/$1D/
- xform/(.)en$/$1F/
- xform/(.)eng$/$1G/
- xform/[iu]ang$/L/
- xform/(.)ang$/$1H/
- xform/ian$/M/
- xform/(.)an$/$1J/
- xform/(.)ou$/$1Z/
- xform/[iu]a$/X/
- xform/iao$/N/
- xform/(.)ao$/$1C/
- xform/ui$/V/
- xform/in$/B/
- xlit/QWRTYUIOPSDFGHJKLZXCVBNM/qwrtyuiopsdfghjklzxcvbnm/
- xform/iu$/ǫ/
- xform/(.)ei$/$1ᴡ/
- xform/uan$/ʀ/
- xform/[uv]e$//
- xform/un$/ʏ/
- xform/^sh//
- xform/^ch/ɪ/
- xform/^zh//
- xform/uo$//
- xform/ie$//
- xform/i?ong$/s/
- xform/ing$|uai$//
- xform/(.)ai$/$1ᴅ/
- xform/(.)en$/$/
- xform/(.)eng$/$/
- xform/[iu]ang$/ʟ/
- xform/(.)ang$/$/
- xform/ian$//
- xform/(.)an$/$1ᴊ/
- xform/(.)ou$/$1ᴢ/
- xform/[iu]a$/x/
- xform/iao$/ɴ/
- xform/(.)ao$/$1ᴄ/
- xform/ui$//
- xform/in$/ʙ/
- xlit/ǫᴡʀᴛʏᴜɪᴏᴘsᴅғɢʜᴊᴋʟᴢxᴄᴠʙɴᴍ/qwrtyuiopsdfghjklzxcvbnm/
- abbrev/^(.).+$/$1/ # 首字母简拼
# 可输入大写字母。因为上面的双拼拼写规则用掉了大写字母。做了 xlit 转写,同时适配全拼和双拼。
- xlit/āḃçďēḟḡĥīĵḱĺḿńōṕɋŕśťūṽẃẋȳź/ABCDEFGHIJKLMNOPQRSTUVWXYZ/

56 changes: 27 additions & 29 deletions double_pinyin_mspy.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,34 +241,32 @@ speller:
- derive/^([jqxy])u$/$1v/
- derive/^([aoe].*)$/o$1/
- xform/^([ae])(.*)$/$1$1$2/
- xform/iu$/Q/
- xform/[iu]a$/W/
- xform/er$|[uv]an$/R/
- xform/[uv]e$/T/
- xform/v$|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/
- derive/T$/V/
- xform/(.)ou$/$1B/
- xform/in$/N/
- xform/iu$/ǫ/
- xform/[iu]a$//
- xform/er$|[uv]an$/ʀ/
- xform/[uv]e$//
- xform/v$|uai$/ʏ/
- xform/^sh//
- xform/^ch/ɪ/
- xform/^zh//
- xform/uo$//
- xform/[uv]n$//
- xform/i?ong$/s/
- xform/[iu]ang$//
- xform/(.)en$/$/
- xform/(.)eng$/$/
- xform/(.)ang$/$/
- xform/ian$//
- xform/(.)an$/$1ᴊ/
- xform/iao$//
- xform/(.)ao$/$1ᴋ/
- xform/(.)ai$/$/
- xform/(.)ei$/$1ᴢ/
- xform/ie$/x/
- xform/ui$//
- derive/T$//
- xform/(.)ou$/$/
- xform/in$/ɴ/
- xform/ing$/;/
- xlit/QWRTYUIOPSDFGHMJCKLZXVBN/qwrtyuiopsdfghmjcklzxvbn/
- xlit/ǫᴡʀᴛʏᴜɪᴏᴘsᴅғɢʜᴍᴊᴄᴋʟᴢxᴠʙɴ/qwrtyuiopsdfghmjcklzxvbn/
- abbrev/^(.).+$/$1/ # 首字母简拼
# 可输入大写字母。因为上面的双拼拼写规则用掉了大写字母。做了 xlit 转写,同时适配全拼和双拼。
- xlit/āḃçďēḟḡĥīĵḱĺḿńōṕɋŕśťūṽẃẋȳź/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
52 changes: 25 additions & 27 deletions double_pinyin_ziguang.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,32 +237,30 @@ speller:
algebra:
- erase/^xx$/
- derive/^([jqxy])u$/$1v/
- xform/^([aoe].*)$/O$1/ # 添上固定的零聲母o,先標記爲大寫O
- xform/en$/W/
- xform/eng$/T/
- xform/in$|uai$/Y/
- xform/^zh/U/
- xform/^sh/I/
- xform/uo$/O/
- xform/ai$/P/
- xform/^ch/A/
- xform/[iu]ang$/G/
- xform/ang$/S/ # ang should be placed after iang/uang
- xform/ie$/D/
- xform/ian$/F/
- xform/i?ong$/H/
- xform/er$|iu$/J/
- xform/ei$/K/
- xform/uan$/L/
- xform/^([aoe].*)$/$1/ # 添上固定的零聲母o,先標記爲大寫O
- xform/en$//
- xform/eng$//
- xform/in$|uai$/ʏ/
- xform/^zh//
- xform/^sh/ɪ/
- xform/uo$//
- xform/ai$//
- xform/^ch//
- xform/[iu]ang$/ɢ/
- xform/ang$/s/ # ang should be placed after iang/uang
- xform/ie$//
- xform/ian$/ғ/
- xform/i?ong$/ʜ/
- xform/er$|iu$//
- xform/ei$//
- xform/uan$/ʟ/
- xform/ing$/;/
- xform/ou$/Z/
- xform/[iu]a$/X/
- xform/iao$/B/
- xform/ue$|ui$|ve$/N/
- xform/un$/M/
- xform/ao$/Q/ # ao should be placed after iao
- xform/an$/R/ # an should be placed after uan/ian
- xlit/WTYUIOPAGSDFHJKLZXBNMQR/wtyuiopagsdfhjklzxbnmqr/
- xform/ou$//
- xform/[iu]a$/x/
- xform/iao$/ʙ/
- xform/ue$|ui$|ve$/ɴ/
- xform/un$//
- xform/ao$/ǫ/ # ao should be placed after iao
- xform/an$/ʀ/ # an should be placed after uan/ian
- xlit/ᴡᴛʏᴜɪᴏᴘᴀɢsᴅғʜᴊᴋʟᴢxʙɴᴍǫʀ/wtyuiopagsdfhjklzxbnmqr/
- abbrev/^(.).+$/$1/ # 首字母简拼
# 可输入大写字母。因为上面的双拼拼写规则用掉了大写字母。做了 xlit 转写,同时适配全拼和双拼。
- xlit/āḃçďēḟḡĥīĵḱĺḿńōṕɋŕśťūṽẃẋȳź/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
1 change: 0 additions & 1 deletion en_dicts/cn_en.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Beta版本 Betabanben
AV女优 AVnvyou
X战警 Xzhanjing
YY语音 YYyuyin
A4 Asi
A4纸 Asizhi
A4腰 Asiyao
N多 Nduo
Expand Down
1 change: 0 additions & 1 deletion en_dicts/cn_en_double_pinyin.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Beta版本 Betabjbf
AV女优 AVnvyb
X战警 Xvjjy
YY语音 YYyuyn
A4 Asi
A4纸 Asivi
A4腰 Asiyk
N多 Ndo
Expand Down
1 change: 0 additions & 1 deletion en_dicts/cn_en_double_pinyin_abc.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Beta版本 Betabjbf
AV女优 AVnvyb
X战警 Xajjy
YY语音 YYyuyc
A4 Asi
A4纸 Asiai
A4腰 Asiyk
N多 Ndo
Expand Down
1 change: 0 additions & 1 deletion en_dicts/cn_en_double_pinyin_flypy.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Beta版本 Betabjbf
AV女优 AVnvyz
X战警 Xvjjk
YY语音 YYyuyb
A4 Asi
A4纸 Asivi
A4腰 Asiyc
N多 Ndo
Expand Down
1 change: 0 additions & 1 deletion en_dicts/cn_en_double_pinyin_mspy.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Beta版本 Betabjbf
AV女优 AVnvyb
X战警 Xvjj;
YY语音 YYyuyn
A4 Asi
A4纸 Asivi
A4腰 Asiyk
N多 Ndo
Expand Down
1 change: 0 additions & 1 deletion en_dicts/cn_en_double_pinyin_ziguang.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Beta版本 Betabrbw
AV女优 AVnvyz
X战警 Xurj;
YY语音 YYyuyy
A4 Asi
A4纸 Asiui
A4腰 Asiyq
N多 Ndo
Expand Down
4 changes: 3 additions & 1 deletion en_dicts/en_ext.dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ New Technology File System NTFS
New Technology File System NewTechnologyFileSystem
Microsoft NTFS NTFS
Microsoft NTFS MicrosoftNTFS
chromeOS chromeOS
ChromeOS ChromeOS
GCD GCD
Grand Central Dispatch GCD
Grand Central Dispatch GrandCentralDispatch
Expand Down Expand Up @@ -2253,3 +2253,5 @@ Kubernetes Kubernetes
containerized containerized
shitty shitty
shitwork shitwork
A4 A4
3D 3D
2 changes: 0 additions & 2 deletions melt_eng.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ speller:
- derive/[^a-zA-Z0-9]//
# 禁用非英文、数字开头的编码
- erase/^[\W|_].+$/
# 当开启自动调频时,保证大写+小写开头的词排在全大写的前面
# - derive/^([A-Z][A-Z]+)[a-z]+/$1/
# 全小写
- derive/^.+$/\L$0/
# 全大写
Expand Down
3 changes: 0 additions & 3 deletions rime_ice.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,6 @@ speller:
- derive/^([jqxy])u/$1v/
- derive/^([jqxy])v/$1u/

### 可输入大写字母,做了 xlit 转写是为了适配双拼
- xlit/āḃçďēḟḡĥīĵḱĺḿńōṕɋŕśťūṽẃẋȳź/ABCDEFGHIJKLMNOPQRSTUVWXYZ/

### 自动纠错
# 有些规则对全拼简拼混输有副作用:如「x'ai 喜爱」被纠错为「xia 下」
# zh、ch、sh
Expand Down

0 comments on commit cc83a1a

Please sign in to comment.