Expand description
Return versioned HSK level for Simplified Chinese characters.
The crate embeds the published simplified-word catalogs and performs allocation-free catalog lookup. Query normalization allocates only when normalization or a returned result requires it.
use hsk::{HskLevel, HskQuery, HskSystem};
let result = hsk::levels(
HskSystem::Hsk2015,
HskQuery::new("爱").pinyin("ai4"),
)?;
assert_eq!(result, [HskLevel::One]);Structs§
- HskQuery
- A simplified Chinese word with optional pinyin for disambiguation.
Enums§
- HskError
- A malformed lookup query.
- HskLevel
- A level assigned by a selected classification.
- HskSystem
- A published HSK or Chinese-proficiency classification.
Functions§
- levels
- Return every level matching a query in one classification.
- levels_
all - Return matching levels from every classification containing the word.