Struct jieba_rs::Jieba [−][src]
pub struct Jieba { /* fields omitted */ }
Jieba segmentation
Methods
impl Jieba
[src]
impl Jieba
pub fn empty() -> Self
[src]
pub fn empty() -> Self
Create a new instance with empty dict
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new instance with embed dict
pub fn with_dict<R: BufRead>(dict: &mut R) -> Result<Self>
[src]
pub fn with_dict<R: BufRead>(dict: &mut R) -> Result<Self>
Create a new instance with dict
pub fn add_word(
&mut self,
word: &str,
freq: Option<usize>,
tag: Option<&str>
) -> usize
[src]
pub fn add_word(
&mut self,
word: &str,
freq: Option<usize>,
tag: Option<&str>
) -> usize
Add word to dict, return freq
freq
: if None
, will be given by suggest_freq
tag
: if None
, will be given ""
pub fn load_dict<R: BufRead>(&mut self, dict: &mut R) -> Result<()>
[src]
pub fn load_dict<R: BufRead>(&mut self, dict: &mut R) -> Result<()>
Load dictionary
pub fn suggest_freq(&self, segment: &str) -> usize
[src]
pub fn suggest_freq(&self, segment: &str) -> usize
Suggest word frequency to force the characters in a word to be joined or splitted.
pub fn cut<'a>(&self, sentence: &'a str, hmm: bool) -> Vec<&'a str>
[src]
pub fn cut<'a>(&self, sentence: &'a str, hmm: bool) -> Vec<&'a str>
pub fn cut_all<'a>(&self, sentence: &'a str) -> Vec<&'a str>
[src]
pub fn cut_all<'a>(&self, sentence: &'a str) -> Vec<&'a str>
pub fn cut_for_search<'a>(&self, sentence: &'a str, hmm: bool) -> Vec<&'a str>
[src]
pub fn cut_for_search<'a>(&self, sentence: &'a str, hmm: bool) -> Vec<&'a str>
pub fn tokenize<'a>(
&self,
sentence: &'a str,
mode: TokenizeMode,
hmm: bool
) -> Vec<Token<'a>>
[src]
pub fn tokenize<'a>(
&self,
sentence: &'a str,
mode: TokenizeMode,
hmm: bool
) -> Vec<Token<'a>>
pub fn tag<'a>(&'a self, sentence: &'a str, hmm: bool) -> Vec<Tag<'a>>
[src]
pub fn tag<'a>(&'a self, sentence: &'a str, hmm: bool) -> Vec<Tag<'a>>
Trait Implementations
impl Debug for Jieba
[src]
impl Debug for Jieba
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Jieba
[src]
impl Default for Jieba