From 0d11ba0136261f7a26e4d8879345d7b6e757edd5 Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Fri, 19 Jan 2024 23:57:43 +0600 Subject: [PATCH] Update emojicon Use custom flavored emoji shortcodes --- Cargo.toml | 2 +- src/phonetic/suggestion.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7de7875..64b9601 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ codegen-units = 1 [dependencies] ahash = { version = "0.8", features = ["serde"] } -emojicon = "0.3" +emojicon = { version = "0.4", features = ["custom"] } serde_json = "1.0" regex = "~1.9" # For maintaining MSRV stringplus = "0.1" diff --git a/src/phonetic/suggestion.rs b/src/phonetic/suggestion.rs index 192ce7f..209641b 100644 --- a/src/phonetic/suggestion.rs +++ b/src/phonetic/suggestion.rs @@ -458,6 +458,12 @@ mod tests { ["চুল", "😎", "🆒", "চোল", "চল", "চূল", "ছুল", "ছোল", "ছল", "ছুঁল"] ); + suggestion.suggest("chup", &data, &mut selections, &config); + assert_eq!( + suggestion.suggestions, + ["ছুপ", "🫢", "চুপ"] + ); + suggestion.suggest(".", &data, &mut selections, &config); assert_eq!(suggestion.suggestions, ["।"]); }