pub struct TextProcessor {
pub normalize_text: bool,
pub aggressive_normalize: bool,
pub transliterate: bool,
pub replace_homoglyphs: bool,
/* private fields */
}Fields§
§normalize_text: bool§aggressive_normalize: bool§transliterate: bool§replace_homoglyphs: boolImplementations§
Source§impl TextProcessor
impl TextProcessor
pub fn new( normalize_text: bool, aggressive_normalize: bool, transliterate: bool, replace_homoglyphs: bool, ) -> Self
pub fn load_from_dir(&mut self, data_dir: &Path) -> Result<(), Box<dyn Error>>
Sourcepub fn load_from_str(
&mut self,
unicode_mappings_json: &str,
homoglyphs_json: &str,
transliteration_json: &str,
) -> Result<(), Box<dyn Error>>
pub fn load_from_str( &mut self, unicode_mappings_json: &str, homoglyphs_json: &str, transliteration_json: &str, ) -> Result<(), Box<dyn Error>>
Load processor data from string content (no filesystem). Use for WASM/embedded.
pub fn process_text(&self, text: &str) -> String
Trait Implementations§
Source§impl Clone for TextProcessor
impl Clone for TextProcessor
Source§fn clone(&self) -> TextProcessor
fn clone(&self) -> TextProcessor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextProcessor
impl RefUnwindSafe for TextProcessor
impl Send for TextProcessor
impl Sync for TextProcessor
impl Unpin for TextProcessor
impl UnsafeUnpin for TextProcessor
impl UnwindSafe for TextProcessor
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