use crate::error::MecoError;
use crate::word::nature::Nature;
use crate::word::shape_word::ShapeWord;
pub(crate) trait LetterTranslateRuleFrom: Sync {
fn get_mapper_code(
&self,
pre: &[char],
suf: &[char],
key: &str,
nature: Nature,
) -> Option<&'static str>;
fn contains(&self, key: &str) -> bool;
fn get_code_nature(&self, c: char) -> Nature;
fn is_translate_code_point(&self, c: char) -> bool;
fn is_word_code_point(&self, c: char) -> bool;
}
pub(crate) const WORD_CONNECTOR: char = '\u{202f}';
pub(crate) fn ends_with_boundary(s: &str) -> bool {
matches!(s.chars().last(), Some(' ') | Some(WORD_CONNECTOR))
}
pub(crate) trait LetterTranslateRuleTo: Sync {
fn get_mapper_code(&self, builder: &mut String, word: &ShapeWord) -> Result<(), MecoError>;
fn contains(&self, key: &str) -> bool;
fn is_translate_code_point(&self, c: char) -> bool;
}