Skip to content

Commit 96c4681

Browse files
committed
Update unicode cldr (Riey#678)
* Update unicode cldr * Update docs * Only add emojis to dict
1 parent 1da56e0 commit 96c4681

File tree

7 files changed

+4663
-1619
lines changed

7 files changed

+4663
-1619
lines changed

Cargo.lock

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

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### Improve
88

9+
* Update Unicode CLDR version to 45 [#674](https://github.com/Riey/kime/issues/674)
10+
911
## 3.1.0
1012

1113
### Improve

src/engine/core/tests/emoji.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn thinking() {
1212
test_input(&[
1313
(EMOJI, "🏻(light skin tone)🏼(medium-light skin tone)🏽(medium skin tone)🏾(medium-dark skin tone)🏿(dark skin tone)", ""),
1414
(Key::normal(T), "t🏻(light skin tone)🏼(medium-light skin tone)🏽(medium skin tone)🏾(medium-dark skin tone)🏿(dark skin tone)", ""),
15-
(Key::normal(H), "th😁(beaming face with smiling eyes)😂(face with tears of joy)🤣(rolling on the floor laughing)😃(grinning face with big eyes)😄(grinning face with smiling eyes)", ""),
15+
(Key::normal(H), "th😃(grinning face with big eyes)😄(grinning face with smiling eyes)😁(beaming face with smiling eyes)😅(grinning face with sweat)🤣(rolling on the floor laughing)", ""),
1616
(Key::normal(I), "thi🤔(thinking face)🕧(twelve-thirty)🕜(one-thirty)🕝(two-thirty)🕞(three-thirty)", ""),
1717
(Key::normal(N), "thin🤔(thinking face)", ""),
1818
(Key::normal(K), "think🤔(thinking face)", ""),

src/engine/dict/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ license = "GPL-3.0-or-later"
88
[build-dependencies]
99
serde = {version = "1.0.118", features = ["derive"]}
1010
serde_json = "1.0"
11-
itertools = "0.10.0"
11+
itertools = "0.13.0"
1212
quick-xml = { version = "0.27.1", features = ["encoding"] }
13+
unic = "0.9.0"

src/engine/dict/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::{
1111
mem,
1212
path::PathBuf,
1313
};
14+
use unic::emoji::char::is_emoji;
1415

1516
#[derive(Default, Debug, Clone, Copy)]
1617
struct HanjaEntry {
@@ -203,6 +204,10 @@ fn main() {
203204
)
204205
.unwrap();
205206
for entry in load_unicode_annotations().unwrap() {
207+
if !entry.cp.chars().any(|c| is_emoji(c)) {
208+
continue;
209+
}
210+
206211
writeln!(
207212
out,
208213
"UnicodeAnnotation {{ codepoint: \"{}\", tts: \"{}\" }},",

0 commit comments

Comments
 (0)