Skip to content

Commit 0eddd3e

Browse files
committed
fix: order of and 𠃊
1 parent 9b5769b commit 0eddd3e

File tree

6 files changed

+370
-577
lines changed

6 files changed

+370
-577
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "libre-flypy"
33
authors = ["OverflowCat"]
4-
version = "1.0.0"
4+
version = "1.2.0"
55
edition = "2021"
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
自由小鹤是一个自由的小鹤音形码表实现,旨在通过代码基于开源的数据上生成一套小鹤音形码表,并补全 Unicode 中存在但小鹤音形未编码的汉字。
44

5-
注意,本项目目前处于早期开发阶段,不保证生成的码表的正确性。
65

7-
目前表内形码的正确性为 **7884 / 8106 (97.26%)** 字,全码的正确性为 **7872 / 8106 (97.11%)** 字,输出共计 **52721** 个编码。
6+
目前表内形码的正确性为 **7900 / 8106 (97.46%)** 字,全码的正确性为 **7888 / 8106 (97.31%)** 字,输出共计 **52721** 个编码。
87

98
目前表内全码错误或缺失的字:
109

1110
```
12-
厂匕几九刁力又于才寸大丈与万口山巾及亡尸卫女飞丰井夫丐木五不车巨屯戈中内水见午牛手毛壬升长凶月氏丹方火斗丑书玉未末世本戊平东北业目且甲申电由史央皿凹生矢失乍丘乎甩印乐册永民弗出发母耳吏西夹夷尧曲朱廷乔臼舟兆争亥充米农声严求甫更束两来肖串我身龟免弃武丧画事雨妻齿果制垂秉所夜单肃承陋函柬面骨幽钙卸养逆乘旅兼继曹雀兜象毫涵寇惠翘凿鼎鹉毁颖毅赢疆乜廿卅尹夬爿毋耒曳凼聿艮丞卣沔臾亟眄禺鸩釜蚩堇菡啬啮颍彀嗯嵊滏榖臧廛畿縠墼羲豳篾卬𠙶毌㧑尨伭卺叚郪隺烝崡庳婳堾堼棤黹颋䐃𬭚漦酂彟
11+
匕几九力又于才寸大丈与万口巾及尸卫女丰井夫无丐木五不尤车巨屯中内水见午牛手毛壬升长月氏丹方火斗丑书玉未末世本戊平东北业目且甲申电由史央皿凹生矢失乍丘乎甩印乐册永民弗出发母耳吏西夹夷曲朱廷乔臼舟兆争亥充米农严求甫更束两尬来肖串我身龟免弃武丧事妻果制垂秉所夜单肃承陋函柬面骨幽钙卸养逆乘旅兼继曹雀兜象毫断寇惠鼎鹉尴毁颖毅疆乜廿卅夬爿毋耒尥曳聿艮丞卣沔臾亟眄禺鸩釜蚩堇啬颍彀嗯嵊滏榖臧廛畿縠墼羲豳篾卬𠙶毌㧑尪伭卺叚郪隺烝庳堾堼棤黹颋䐃𬭚漦酂彟
1312
```
1413

1514
## 使用
@@ -36,7 +35,9 @@
3635

3736
## 贡献
3837

39-
欢迎提交 PR。如果想修复错误的形码,最好的方式是在 [my_ids.txt](./my_ids.txt) 中添加符合笔顺和拆字方式的表意文字描述序列。
38+
本项目虽然力求与官方码表保持一致,但不保证生成的码表的完全正确。
39+
40+
不过,欢迎提交 PR 以增添新字或修正错码。如果想修复错误的形码,最好的方式是在 [my_ids.txt](./my_ids.txt) 中添加符合笔顺和拆字方式的表意文字描述序列。
4041

4142
## 协议
4243

my_ids.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
⺆ ⺆
44
⺕ ⺕
55
〇 〇
6-
コ コ
76
ヨ ヨ
87
㇀ ㇀
98
㇁ ㇁
@@ -28,13 +27,17 @@
2827
其 其
2928
甚 ⿱其㇄
3029
具 ⿱且八
30+
コ ⿱𠃍一
31+
厂 ⿻一丿
32+
亡 ⿱亠㇄(H,J) ⿱亠乚(sg);⿱亠𠃊(.,V);⿱亠𠄌(.t,st)
3133
𫩏 ⿱⿰丨𠃍⿱丨一
3234
凸 ⿻⿰丨㇎⿱⿰一丨一(seq)
3335
七 ⿻一乚
3436
十 ⿻一丨
3537
人 ⿰丿乀
3638
入 ⿰丿乀
3739
𬼀 ⿱丶丿
40+
𭠍 ⿻⿱一丿㇂
3841
己 ⿳𠃍一乚
3942
已 ⿳𠃍一乚
4043
巳 ⿳𠃍一乚
@@ -89,6 +92,7 @@
8992
嬴 ⿱吂⿲月女凡
9093
蠃 ⿱吂⿲月虫凡
9194
羸 ⿱吂⿲月羊凡
95+
赢 ⿱吂⿲月贝凡
9296
隺 ⿻⿰丶乛隹(.)
9397
穴 ⿱宀八(.,T,J,K) ⿱宀儿(j.w,jsg,jsw)
9498
省 ⿱少目(.,H)
@@ -106,3 +110,4 @@
106110
齑 ⿱文⿲丿韭丨
107111
戢 ⿱口⿻戈⿻⿲丨⿱一一丨一//口戈丨丨
108112
𦰩 ⿱艹⿻口⿻⿻二丿乀
113+
尹 ⿻⿻⿱𠃍一一丿

src/ids/pn.rs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,16 @@ impl From<&str> for Tree {
103103
let mut stack = Vec::with_capacity(3);
104104
for c in s.chars().rev() {
105105
if let Ok(idc) = Idc::try_from(c) {
106-
// if idc == Idc::SurroundFromBelow {
107-
// println!("<< {}: {:?} >>", s, idc);
108-
// }
109-
let children = (0..idc.get_children_count())
106+
let mut children: Vec<_> = (0..idc.get_children_count())
110107
.map(|_| stack.pop().expect("Not enough children."))
111108
.collect();
109+
if idc == Idc::SurroundFromBelow {
110+
if let Tree::Leaf { value } = children[0] {
111+
if ['凵', '𠃊'].contains(&value) {
112+
children.swap(0, 1);
113+
}
114+
}
115+
}
112116
let node = Tree::Node {
113117
idc,
114118
children,
@@ -155,15 +159,15 @@ impl Tree {
155159
Tree::Node {
156160
idc: _, children, ..
157161
} => {
158-
let mut child = &children[0];
159-
match child {
160-
Tree::Leaf { value, .. } => {
161-
if ['凵', '𠃊'].contains(value) {
162-
child = &children[1];
163-
}
164-
}
165-
_ => {}
166-
}
162+
let child = &children[0];
163+
// match child {
164+
// Tree::Leaf { value, .. } => {
165+
// if ['𠃊'].contains(value) {
166+
// child = &children[1];
167+
// }
168+
// }
169+
// _ => {}
170+
// }
167171
child.get_first_leaf()
168172
}
169173
Tree::Leaf { value } => *value,

0 commit comments

Comments
 (0)