Expand description
§Dictionary Integration Module
시스템 사전과 사용자 사전을 통합하여 형태소 검색을 제공합니다.
§구조
SystemDictionary: Trie + Matrix + Features를 통합한 시스템 사전DictionaryLoader: 사전 경로 탐색 및 로딩- 환경변수 기반 사전 경로 지원 (
MECAB_DICDIR) - 메모리 맵 기반 효율적 로딩
§예제
ⓘ
use mecab_ko_dict::dictionary::SystemDictionary;
// 기본 경로에서 로드
let dict = SystemDictionary::load_default().unwrap();
// 특정 경로에서 로드
let dict = SystemDictionary::load("/usr/local/lib/mecab/dic/mecab-ko-dic").unwrap();
// 형태소 검색
let entries = dict.lookup("안녕");
for entry in entries {
println!("{}: {}", entry.surface, entry.feature);
}Structs§
- Dict
Entry - 사전 엔트리 (내부 표현)
- Dictionary
Loader - 사전 로더
- Load
Options - 사전 로드 옵션
- System
Dictionary - 시스템 사전