pub struct Jieba { /* private fields */ }
Expand description
Jieba segmentation
Implementations§
Source§impl Jieba
impl Jieba
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance with embed dict
Requires default-dict
feature to be enabled.
Sourcepub fn with_dict<R: BufRead>(dict: &mut R) -> Result<Self, Error>
pub fn with_dict<R: BufRead>(dict: &mut R) -> Result<Self, Error>
Create a new instance with dict
Sourcepub fn add_word(
&mut self,
word: &str,
freq: Option<usize>,
tag: Option<&str>,
) -> usize
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 ""
Sourcepub fn suggest_freq(&self, segment: &str) -> usize
pub fn suggest_freq(&self, segment: &str) -> usize
Suggest word frequency to force the characters in a word to be joined or split.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Jieba
impl RefUnwindSafe for Jieba
impl Send for Jieba
impl Sync for Jieba
impl Unpin for Jieba
impl UnwindSafe for Jieba
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