pub(crate) enum CanonicalCompositionsRef<'data> {
Current(&'data FastCodePointTrie<'data, u16>, &'data ZeroSlice<(u16, u16)>, &'data ZeroSlice<(char, char)>),
}Variants§
Current(&'data FastCodePointTrie<'data, u16>, &'data ZeroSlice<(u16, u16)>, &'data ZeroSlice<(char, char)>)
Implementations§
Source§impl<'data> CanonicalCompositionsRef<'data>
impl<'data> CanonicalCompositionsRef<'data>
Sourcepub(crate) fn compose(&self, starter: char, second: char) -> Option<char>
pub(crate) fn compose(&self, starter: char, second: char) -> Option<char>
Performs canonical composition (including Hangul) on a pair of
characters or returns None if these characters don’t compose.
Composition exclusions are taken into account.
TODO: Have the caller retain more state and have this function return more information that is useful for retaining information between attempts to compose in a sequence of such attempts:
- We can return the linear search slice when we search through it but don’t find anything.
- We can know that no further matches are possible.
- We can know that the starter was a special ASCII vowel.
- We can know that we just formed a Hangul LV syllable.
Sourcepub(crate) fn compose_starter(
&self,
starter: char,
second: char,
starter_is_lv: bool,
) -> Option<(char, bool)>
pub(crate) fn compose_starter( &self, starter: char, second: char, starter_is_lv: bool, ) -> Option<(char, bool)>
Performs canonical composition (including Hangul) on a pair of
characters on the assumption that the second one is a starter
or returns None if these characters don’t compose.
Composition exclusions are taken into account.
The returned boolean can be true only if char a Hangul LV syllable.
The argument starter_is_lv must be set either to false or to the value
that this method previously returned alongside starter.