[−][src]Struct chinese_dictionary::ChineseDictionary
Implementations
impl Dictionary
[src]
pub fn new() -> Dictionary
[src]
pub fn classify(&self, raw: &str) -> ClassificationResult
[src]
Classify
Classify a string of text as either Pinyin, English, or Chinese characters.
For more information on the possible ClassificationResult
enum values refer to the README.
pub fn convert_to_simplified(&self, raw: &str) -> String
[src]
Convert to Simplified
Convert a string of Traditional Chinese characters to their Simplified form.
pub fn convert_to_traditional(&self, raw: &str) -> String
[src]
Convert to Traditional
Convert a string of Simplified Chinese characters to their Traditional form.
pub fn is_traditional(&self, raw: &str) -> bool
[src]
Is Traditional
Checks if a string of Chinese characters is Traditional
pub fn is_simplified(&self, raw: &str) -> bool
[src]
Is Simplified
Checks if a string of Chinese characters is Simplified
pub fn segment(&self, raw: &str) -> Vec<String>
[src]
Segment
Segment a string of either Traditional or Simplified Chinese characters into constituent words. Uses a largest first matching dictionary driven approach.
pub fn query_by_english(&self, raw: &str) -> Vec<&WordEntry>
[src]
Query by English
Query the dictionary specifically with English. Uses a largest first matching approach to look for compound words within the provided string. Will attempt to take the shortest of four tokens or the total number of tokens in the string to match against.
pub fn query_by_pinyin(&self, raw: &str) -> Vec<&WordEntry>
[src]
Query by Pinyin
Query the dictionary specifically with Pinyin. Uses space as a token delineator. Supports pinyin with no tones, tone marks, and tone numbers.
pub fn query_by_chinese(&self, raw: &str) -> Vec<&WordEntry>
[src]
Query by Chinese
Query the dictionary specifically with Chinese characters. Supports both Traditional and Simplified Chinese characters.
pub fn query(&self, raw: &str) -> Option<Vec<&WordEntry>>
[src]
Query
Query the dictionary using Traditional Chinese characters, Simplified Chinese characters, English, pinyin with no tone marks, pinyin with tone numbers, and pinyin with tone marks.
When querying using any of the supported pinyin options, space is used as a token delineator.
When querying using English, a largest first matching approached is used to look for compound words. Will attempt to take the shortest of four tokens or the total number of tokens in the string to match against.
Auto Trait Implementations
impl RefUnwindSafe for Dictionary
[src]
impl Send for Dictionary
[src]
impl Sync for Dictionary
[src]
impl Unpin for Dictionary
[src]
impl UnwindSafe for Dictionary
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,