pub struct TrieBuilder;Expand description
Trie 빌더
키-값 쌍에서 Double-Array Trie를 빌드합니다.
Implementations§
Source§impl TrieBuilder
impl TrieBuilder
Sourcepub fn build(entries: &[(&str, u32)]) -> Result<Vec<u8>, DictError>
pub fn build(entries: &[(&str, u32)]) -> Result<Vec<u8>, DictError>
정렬된 키-값 쌍에서 Trie 빌드
§Errors
엔트리가 비어있거나 Trie 빌드에 실패한 경우 에러를 반환합니다.
use mecab_ko_dict::trie::TrieBuilder;
let entries = vec![("가", 0u32), ("가다", 1), ("가방", 2)];
let bytes = TrieBuilder::build(&entries).unwrap();
assert!(!bytes.is_empty());Auto Trait Implementations§
impl Freeze for TrieBuilder
impl RefUnwindSafe for TrieBuilder
impl Send for TrieBuilder
impl Sync for TrieBuilder
impl Unpin for TrieBuilder
impl UnsafeUnpin for TrieBuilder
impl UnwindSafe for TrieBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more