pub struct SystemDictionary { /* private fields */ }Expand description
시스템 사전
Trie, Matrix, Features를 통합하여 형태소 검색과 연접 비용 계산을 제공합니다. 메모리 맵 기반으로 로드되어 효율적이며, 여러 인스턴스 간 메모리 공유가 가능합니다.
Implementations§
Source§impl SystemDictionary
impl SystemDictionary
Sourcepub fn load_default() -> Result<SystemDictionary, DictError>
pub fn load_default() -> Result<SystemDictionary, DictError>
기본 경로에서 사전 로드
다음 순서로 사전 경로를 탐색합니다:
MECAB_DICDIR환경변수- 기본 경로 목록 (
DEFAULT_DICDIR_PATHS)
§Errors
- 사전 파일을 찾을 수 없는 경우
- 사전 파일 포맷이 잘못된 경우
Sourcepub fn load_memory_optimized() -> Result<SystemDictionary, DictError>
pub fn load_memory_optimized() -> Result<SystemDictionary, DictError>
기본 경로에서 메모리 최적화 옵션으로 사전 로드
mmap과 lazy loading을 사용하여 메모리 사용량을 줄입니다.
§Errors
- 사전 파일을 찾을 수 없는 경우
- 사전 파일 포맷이 잘못된 경우
Sourcepub fn load_with_options<P>(
dicdir: P,
options: LoadOptions,
) -> Result<SystemDictionary, DictError>
pub fn load_with_options<P>( dicdir: P, options: LoadOptions, ) -> Result<SystemDictionary, DictError>
Sourcepub fn load<P>(dicdir: P) -> Result<SystemDictionary, DictError>
pub fn load<P>(dicdir: P) -> Result<SystemDictionary, DictError>
Sourcepub fn with_user_dictionary(self, user_dict: UserDictionary) -> SystemDictionary
pub fn with_user_dictionary(self, user_dict: UserDictionary) -> SystemDictionary
Sourcepub fn set_user_dictionary(&mut self, user_dict: UserDictionary)
pub fn set_user_dictionary(&mut self, user_dict: UserDictionary)
사용자 사전 설정
Sourcepub const fn matrix(&self) -> &ConnectionMatrix
pub const fn matrix(&self) -> &ConnectionMatrix
Matrix 참조 반환
Sourcepub fn user_dictionary(&self) -> Option<&UserDictionary>
pub fn user_dictionary(&self) -> Option<&UserDictionary>
사용자 사전 참조 반환
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SystemDictionary
impl RefUnwindSafe for SystemDictionary
impl Send for SystemDictionary
impl Sync for SystemDictionary
impl Unpin for SystemDictionary
impl UnsafeUnpin for SystemDictionary
impl UnwindSafe for SystemDictionary
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