Struct opencc::OpenCC [] [src]

pub struct OpenCC {
    pub config: String,
    // some fields omitted
}

Fields

Configuration file

Methods

impl OpenCC
[src]

Constructs a new OpenCC

Examples

let cc = opencc::OpenCC::new("t2s.json");

Convert a text

Examples

let cc = opencc::OpenCC::new("t2s.json");
cc.convert("乾坤一擲").unwrap();
cc.convert("開放中文轉換").unwrap();

Close the underlying libopencc. Will be called automatically when the variable gets out of scope.

Is the underlying libopencc closed

Returns the last error message

Safety

Note that this function is the only one which is NOT thread-safe.

Trait Implementations

impl Drop for OpenCC
[src]

Close the underlying libopencc when it been droped