trie: one node per rune, children in rune order, and the last path kept
The trie walked a key byte by byte, so a Hangul syllable cost three nodes and every lookup first spelled its key back into UTF-8. It walks runes now: a third of the nodes for Korean data, and no buffer in the lookup. Children are kept in rune order, so both the search and the insert stop early, and a trie remembers the path of the last key put, which a file sorted by key — hanja.dict is one — walks straight down.
This commit is contained in:
Reference in New Issue
Block a user