diff --git a/Cargo.toml b/Cargo.toml index 7d4a9e4..2505a63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ar-reshaper" -version = "1.3.0" +version = "1.3.1" authors = ["Saeid Ghafari "] edition = "2021" description = "Reconstruct Arabic sentences to be used in applications that don't support Arabic script." diff --git a/src/reshaper.rs b/src/reshaper.rs index f99a575..b1427a7 100644 --- a/src/reshaper.rs +++ b/src/reshaper.rs @@ -41,6 +41,14 @@ impl ArabicReshaper { } } + /// Check whatever the text need reshaping or not. + pub fn need_reshape(&self, text: S) -> bool + where + S: AsRef + { + text.as_ref().chars().any(|c| self.letters.contains_key(&c)) + } + /// Reshape the given line and return the reshaped string pub fn reshape(&self, text: S) -> String where