Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

use unicode_script crate to check chars are Latin script inside `is_english_lingual`

hippietrail7e35fb41d041
diff --git a/harper-core/Cargo.toml b/harper-core/Cargo.toml
index 4ae24b4bc..b8ed4a55e 100644
--- a/harper-core/Cargo.toml
+++ b/harper-core/Cargo.toml
@@ -22,6 +22,7 @@ serde_json = "1.0.137"
smallvec = { version = "1.13.2", features = ["serde"] }
thiserror = "2.0.11"
unicode-blocks = "0.1.9"
+unicode-script = "0.5.7"
unicode-width = "0.2.0"
levenshtein_automata = { version = "0.2.1", features = ["fst_automaton"] }
diff --git a/harper-core/src/char_ext.rs b/harper-core/src/char_ext.rs
index a13be38be..83879f94b 100644
--- a/harper-core/src/char_ext.rs
+++ b/harper-core/src/char_ext.rs
@@ -1,3 +1,4 @@
+use unicode_script::{Script, UnicodeScript};
use unicode_width::UnicodeWidthChar;
use crate::Punctuation;
@@ -19,6 +20,7 @@ impl CharExt for char {
&& !self.is_punctuation()
&& self.is_alphabetic()
&& !self.is_cjk()
+ && self.script() == Script::Latin
}
fn is_emoji(&self) -> bool {