pub struct Normalizer;Expand description
Normalizer for standardizing text data
Implementations§
Source§impl Normalizer
impl Normalizer
Sourcepub fn normalize_name(name: &str) -> String
pub fn normalize_name(name: &str) -> String
Normalize a name for comparison
- Converts to lowercase
- Removes diacritics
- Trims whitespace
- Removes common punctuation
Sourcepub fn normalize_postcode(postcode: &str) -> String
pub fn normalize_postcode(postcode: &str) -> String
Normalize a postcode for comparison
- Converts to uppercase
- Removes spaces
- Trims whitespace
Sourcepub fn normalize_phone(phone: &str) -> String
pub fn normalize_phone(phone: &str) -> String
Normalize a phone number
- Removes all non-digit characters
- Strips leading zeros and country codes
Sourcepub fn phonetic_code(name: &str) -> String
pub fn phonetic_code(name: &str) -> String
Get phonetic code using Soundex algorithm This helps match names that sound similar but are spelled differently
Auto Trait Implementations§
impl Freeze for Normalizer
impl RefUnwindSafe for Normalizer
impl Send for Normalizer
impl Sync for Normalizer
impl Unpin for Normalizer
impl UnwindSafe for Normalizer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more