pub enum Script {
Latin,
Cjk,
Kana,
Hangul,
Arabic,
Cyrillic,
Devanagari,
Greek,
Hebrew,
Thai,
Mixed,
}Expand description
Unicode script categories for routing similarity algorithms.
Variants§
Latin
Latin script (English, French, German, etc.)
Cjk
CJK (Chinese, Japanese Kanji, Korean Hanja)
Kana
Japanese Hiragana/Katakana
Hangul
Korean Hangul
Arabic
Arabic script
Cyrillic
Cyrillic script (Russian, etc.)
Devanagari
Devanagari (Hindi, Sanskrit, etc.)
Greek
Greek script
Hebrew
Hebrew script
Thai
Thai script
Mixed
Mixed or unknown
Implementations§
Source§impl Script
impl Script
Sourcepub fn detect(s: &str) -> Self
pub fn detect(s: &str) -> Self
Detect the dominant script in a string.
Returns the script that appears most frequently. For mixed scripts (e.g., “東京 (Tokyo)”), returns Mixed if multiple scripts have significant presence (>= 20% of characters).
Sourcepub fn has_word_boundaries(&self) -> bool
pub fn has_word_boundaries(&self) -> bool
Whether this script uses word boundaries (spaces).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Script
impl<'de> Deserialize<'de> for Script
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Script
impl Eq for Script
impl StructuralPartialEq for Script
Auto Trait Implementations§
impl Freeze for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnsafeUnpin for Script
impl UnwindSafe for Script
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more