[][src]Struct chinese_dictionary::ChineseDictionary

pub struct ChineseDictionary { /* fields omitted */ }

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.