Skip to content

Commit

Permalink
Fix okuri update mistake (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
naokiri authored Oct 14, 2022
1 parent 1bd9520 commit d11b36e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ preserve-symlinks = true
# x86_64 specific, depends on cargo-c too.
# Includes development things like static link lib and header files too.
assets = [["assets/**/*", "usr/local/share/libcskk", "644"],
["target/x86_64-unknown-linux-gnu/release/libcskk.so", "usr/local/lib/cskk/libcskk.so.0.10.2", "755"],
["target/x86_64-unknown-linux-gnu/release/libcskk.so", "usr/local/lib/cskk/libcskk.so.0.11.0", "755"],
["deb_assets/libcskk.*", "usr/local/lib/cskk", "777"],
["target/x86_64-unknown-linux-gnu/release/libcskk.a", "usr/local/lib/cskk/", "644"],
["target/x86_64-unknown-linux-gnu/release/cskk.pc", "usr/local/lib/pkgconfig/", "644"],
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ CSKKはSKKと外延的に同値であるため、こう名付けられました

Fcitx5用: [fcitx5-cskk](https://github.com/naokiri/fcitx5-cskk)

説明書: [cskk-docs](https://naokiri.github.io/cskk-docs/)

ロゴ・アイコン類: [cskk-icons](https://github.com/naokiri/cskk-icons)

参考
Expand Down
2 changes: 1 addition & 1 deletion src/dictionary/candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Candidate {
dictionary_cand: &DictionaryCandidate,
) -> Self {
Self {
midashi: composite_key.get_to_composite().to_string(),
midashi: composite_key.get_dict_key(),
okuri: composite_key.has_okuri(),
kouho_text: dictionary_cand.kouho_text.to_owned(),
annotation: dictionary_cand.annotation.to_owned(),
Expand Down
1 change: 1 addition & 0 deletions src/dictionary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ fn get_all_candidates_inner(
/// compositeKeyが送り無しの場合、単なる辞書順
///
/// compositeKeyが送り有りの場合、まず送り仮名の厳密マッチする候補を辞書順に、その後厳密マッチのない候補を辞書順に。
/// つまりddskkのskk-henkan-strict-okuri-precedenceが設定された時の動作を行う。
///
fn get_candidates_in_order(
dictionaries: &[Arc<CskkDictionary>],
Expand Down
1 change: 1 addition & 0 deletions tests/data/dictionaries/strict_okuri_precedence.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
おおk /大/多/[く/多/]/[き/大/]/
47 changes: 47 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1307,3 +1307,50 @@ fn strict_okuri_entry() {
InputMode::Hiragana,
);
}

#[test]
fn strict_okuri_precedence() {
init_test_logger();
let dictpath = "tests/data/dictionaries/strict_okuri_precedence.dat";
let user_dict = CskkDictionary::new_user_dict(dictpath, "utf-8").unwrap();
let mut context = test_context_with_dictionaries(vec![Arc::new(user_dict)]);
transition_check(
&mut context,
CompositionMode::Direct,
InputMode::Hiragana,
"O o K i",
"▼大き",
"",
InputMode::Hiragana,
);
skk_context_reset_rs(&mut context);
transition_check(
&mut context,
CompositionMode::Direct,
InputMode::Hiragana,
"O o K u",
"▼多く",
"",
InputMode::Hiragana,
);
skk_context_reset_rs(&mut context);
transition_check(
&mut context,
CompositionMode::Direct,
InputMode::Hiragana,
"O o K i space Return",
"",
"多き",
InputMode::Hiragana,
);
skk_context_reset_rs(&mut context);
transition_check(
&mut context,
CompositionMode::Direct,
InputMode::Hiragana,
"O o K i ",
"▼多き",
"",
InputMode::Hiragana,
);
}

0 comments on commit d11b36e

Please sign in to comment.