From 201f599cf940f3eff09ff584ace71edeeef4abfc Mon Sep 17 00:00:00 2001 From: Ryo Igarashi Date: Tue, 20 Aug 2024 19:37:03 +0900 Subject: [PATCH] Fix symbol transform order --- ainu-utils-js/Cargo.toml | 2 +- ainu-utils-python/Cargo.toml | 2 +- ainu-utils-python/pyproject.toml | 2 +- ainu-utils/Cargo.toml | 2 +- ainu-utils/src/kana/kana.rs | 3 +-- ainu-utils/src/kana/kana_test.rs | 8 ++++++++ 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ainu-utils-js/Cargo.toml b/ainu-utils-js/Cargo.toml index 556c9e6..27b7eb1 100644 --- a/ainu-utils-js/Cargo.toml +++ b/ainu-utils-js/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ainu-utils-js" -version = "0.3.1" +version = "0.3.2" edition = "2021" description = "A collection of utilities for the Ainu language" license = "MIT" diff --git a/ainu-utils-python/Cargo.toml b/ainu-utils-python/Cargo.toml index 432ac60..c74c4b6 100644 --- a/ainu-utils-python/Cargo.toml +++ b/ainu-utils-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ainu-utils-python" -version = "0.3.1" +version = "0.3.2" edition = "2021" [lib] diff --git a/ainu-utils-python/pyproject.toml b/ainu-utils-python/pyproject.toml index 890420b..81e89a9 100644 --- a/ainu-utils-python/pyproject.toml +++ b/ainu-utils-python/pyproject.toml @@ -9,7 +9,7 @@ features = ["pyo3/extension-module"] name = "ainu-utils" description = "A collection of utility for with the Ainu language" requires-python = ">=3.8" -version = "0.3.1" +version = "0.3.2" license = "MIT" [project.optional-dependencies] diff --git a/ainu-utils/Cargo.toml b/ainu-utils/Cargo.toml index c4d2884..ca1c4e6 100644 --- a/ainu-utils/Cargo.toml +++ b/ainu-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ainu-utils" -version = "0.3.1" +version = "0.3.2" edition = "2021" description = "A collection of utilities for the Ainu language" license = "MIT" diff --git a/ainu-utils/src/kana/kana.rs b/ainu-utils/src/kana/kana.rs index 8c12c57..8ba8c5a 100644 --- a/ainu-utils/src/kana/kana.rs +++ b/ainu-utils/src/kana/kana.rs @@ -15,6 +15,7 @@ pub fn to_kana(input: &str) -> String { input = normalize(input); input = link(input); + input = symbols(input); let chars: Vec = input.chars().collect(); @@ -74,7 +75,5 @@ pub fn to_kana(input: &str) -> String { } } - kana = symbols(kana); - kana } diff --git a/ainu-utils/src/kana/kana_test.rs b/ainu-utils/src/kana/kana_test.rs index f759fb6..b88632b 100644 --- a/ainu-utils/src/kana/kana_test.rs +++ b/ainu-utils/src/kana/kana_test.rs @@ -155,3 +155,11 @@ fn test_special_mm() { fn test_symbols() { assert_eq!(to_kana("“pirka” sekor a=ye"), "「ピㇼカ」 セコㇿ アイェ") } + +#[test] +fn test_k_prefix() { + assert_eq!( + to_kana("irankarapte. kani anak IMO k=e easkay kur ku=ne."), + "イランカラㇷ゚テ。 カニ アナㇰ イモ ケ エアㇱカイ クㇽ クネ。" + ) +}