Type Alias: Segmentation

Segmentation = "lattice" | "eager"

Controls how the engine segments a hanja-containing span into dictionary words and fallback fragments. Corresponds to Rust SegmentationStrategy.

  • "lattice" — Dynamic programming over all possible dictionary matches at each position; selects the segmentation that maximises dictionary coverage and then prefers fewer segments. This is the default and produces better results than greedy approaches when a longer prefix would leave a suffix uncovered by the dictionary. Corresponds to Rust SegmentationStrategy::Lattice.
  • "eager" — Left-to-right longest-match (greedy). Lower overhead per span at the cost of occasional mis-segmentation. Corresponds to Rust SegmentationStrategy::Eager.