pub enum HomophoneDetection {
ContextLocal,
DictionaryWide,
}Expand description
How homophone disambiguation decides that an annotation needs its hanja
shown in RenderMode::HangulOnly.
The two strategies differ in what counts as a homophone collision:
ContextLocal (the default) marks an annotation only when another reading
with a different hanja form actually appears within the same context
window. This keeps hangul-only output clean: a Sino-Korean word is glossed
only when the surrounding text genuinely makes it ambiguous.
DictionaryWide additionally marks an annotation whenever its reading is
shared by any other hanja form anywhere in the dictionary, regardless of
whether those alternatives occur in the text. With a large reference
dictionary such as the Standard Korean Dictionary almost every common
reading has some homophone, so this strategy glosses most Sino-Korean
words. It is preserved as an opt-in for callers that want maximal
disambiguation; words that should always be glossed regardless of context
are better expressed through MatchMark::require_hanja.
Variants§
ContextLocal
Mark only readings that collide within the active context window.
DictionaryWide
Also mark readings shared by other hanja forms anywhere in the dictionary.
Trait Implementations§
Source§impl Clone for HomophoneDetection
impl Clone for HomophoneDetection
Source§fn clone(&self) -> HomophoneDetection
fn clone(&self) -> HomophoneDetection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HomophoneDetection
Source§impl Debug for HomophoneDetection
impl Debug for HomophoneDetection
Source§impl Default for HomophoneDetection
impl Default for HomophoneDetection
Source§fn default() -> HomophoneDetection
fn default() -> HomophoneDetection
impl Eq for HomophoneDetection
Source§impl PartialEq for HomophoneDetection
impl PartialEq for HomophoneDetection
Source§fn eq(&self, other: &HomophoneDetection) -> bool
fn eq(&self, other: &HomophoneDetection) -> bool
self and other values to be equal, and is used by ==.