mod constants {
pub const ETHIOPIC_SYLLABLE_TTHU: char = 'ꬁ';
pub const ETHIOPIC_SYLLABLE_TTHI: char = 'ꬂ';
pub const ETHIOPIC_SYLLABLE_TTHAA: char = 'ꬃ';
pub const ETHIOPIC_SYLLABLE_TTHEE: char = 'ꬄ';
pub const ETHIOPIC_SYLLABLE_TTHE: char = 'ꬅ';
pub const ETHIOPIC_SYLLABLE_TTHO: char = 'ꬆ';
pub const ETHIOPIC_SYLLABLE_DDHU: char = 'ꬉ';
pub const ETHIOPIC_SYLLABLE_DDHI: char = 'ꬊ';
pub const ETHIOPIC_SYLLABLE_DDHAA: char = 'ꬋ';
pub const ETHIOPIC_SYLLABLE_DDHEE: char = 'ꬌ';
pub const ETHIOPIC_SYLLABLE_DDHE: char = 'ꬍ';
pub const ETHIOPIC_SYLLABLE_DDHO: char = 'ꬎ';
pub const ETHIOPIC_SYLLABLE_DZU: char = 'ꬑ';
pub const ETHIOPIC_SYLLABLE_DZI: char = 'ꬒ';
pub const ETHIOPIC_SYLLABLE_DZAA: char = 'ꬓ';
pub const ETHIOPIC_SYLLABLE_DZEE: char = 'ꬔ';
pub const ETHIOPIC_SYLLABLE_DZE: char = 'ꬕ';
pub const ETHIOPIC_SYLLABLE_DZO: char = 'ꬖ';
pub const ETHIOPIC_SYLLABLE_CCHHA: char = 'ꬠ';
pub const ETHIOPIC_SYLLABLE_CCHHU: char = 'ꬡ';
pub const ETHIOPIC_SYLLABLE_CCHHI: char = 'ꬢ';
pub const ETHIOPIC_SYLLABLE_CCHHAA: char = 'ꬣ';
pub const ETHIOPIC_SYLLABLE_CCHHEE: char = 'ꬤ';
pub const ETHIOPIC_SYLLABLE_CCHHE: char = 'ꬥ';
pub const ETHIOPIC_SYLLABLE_CCHHO: char = 'ꬦ';
pub const ETHIOPIC_SYLLABLE_BBA: char = 'ꬨ';
pub const ETHIOPIC_SYLLABLE_BBU: char = 'ꬩ';
pub const ETHIOPIC_SYLLABLE_BBI: char = 'ꬪ';
pub const ETHIOPIC_SYLLABLE_BBAA: char = 'ꬫ';
pub const ETHIOPIC_SYLLABLE_BBEE: char = 'ꬬ';
pub const ETHIOPIC_SYLLABLE_BBE: char = 'ꬭ';
pub const ETHIOPIC_SYLLABLE_BBO: char = 'ꬮ';
}
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub enum EthiopicExtendedA {
EthiopicSyllableTthu,
EthiopicSyllableTthi,
EthiopicSyllableTthaa,
EthiopicSyllableTthee,
EthiopicSyllableTthe,
EthiopicSyllableTtho,
EthiopicSyllableDdhu,
EthiopicSyllableDdhi,
EthiopicSyllableDdhaa,
EthiopicSyllableDdhee,
EthiopicSyllableDdhe,
EthiopicSyllableDdho,
EthiopicSyllableDzu,
EthiopicSyllableDzi,
EthiopicSyllableDzaa,
EthiopicSyllableDzee,
EthiopicSyllableDze,
EthiopicSyllableDzo,
EthiopicSyllableCchha,
EthiopicSyllableCchhu,
EthiopicSyllableCchhi,
EthiopicSyllableCchhaa,
EthiopicSyllableCchhee,
EthiopicSyllableCchhe,
EthiopicSyllableCchho,
EthiopicSyllableBba,
EthiopicSyllableBbu,
EthiopicSyllableBbi,
EthiopicSyllableBbaa,
EthiopicSyllableBbee,
EthiopicSyllableBbe,
EthiopicSyllableBbo,
}
impl Into<char> for EthiopicExtendedA {
fn into(self) -> char {
use constants::*;
match self {
EthiopicExtendedA::EthiopicSyllableTthu => ETHIOPIC_SYLLABLE_TTHU,
EthiopicExtendedA::EthiopicSyllableTthi => ETHIOPIC_SYLLABLE_TTHI,
EthiopicExtendedA::EthiopicSyllableTthaa => ETHIOPIC_SYLLABLE_TTHAA,
EthiopicExtendedA::EthiopicSyllableTthee => ETHIOPIC_SYLLABLE_TTHEE,
EthiopicExtendedA::EthiopicSyllableTthe => ETHIOPIC_SYLLABLE_TTHE,
EthiopicExtendedA::EthiopicSyllableTtho => ETHIOPIC_SYLLABLE_TTHO,
EthiopicExtendedA::EthiopicSyllableDdhu => ETHIOPIC_SYLLABLE_DDHU,
EthiopicExtendedA::EthiopicSyllableDdhi => ETHIOPIC_SYLLABLE_DDHI,
EthiopicExtendedA::EthiopicSyllableDdhaa => ETHIOPIC_SYLLABLE_DDHAA,
EthiopicExtendedA::EthiopicSyllableDdhee => ETHIOPIC_SYLLABLE_DDHEE,
EthiopicExtendedA::EthiopicSyllableDdhe => ETHIOPIC_SYLLABLE_DDHE,
EthiopicExtendedA::EthiopicSyllableDdho => ETHIOPIC_SYLLABLE_DDHO,
EthiopicExtendedA::EthiopicSyllableDzu => ETHIOPIC_SYLLABLE_DZU,
EthiopicExtendedA::EthiopicSyllableDzi => ETHIOPIC_SYLLABLE_DZI,
EthiopicExtendedA::EthiopicSyllableDzaa => ETHIOPIC_SYLLABLE_DZAA,
EthiopicExtendedA::EthiopicSyllableDzee => ETHIOPIC_SYLLABLE_DZEE,
EthiopicExtendedA::EthiopicSyllableDze => ETHIOPIC_SYLLABLE_DZE,
EthiopicExtendedA::EthiopicSyllableDzo => ETHIOPIC_SYLLABLE_DZO,
EthiopicExtendedA::EthiopicSyllableCchha => ETHIOPIC_SYLLABLE_CCHHA,
EthiopicExtendedA::EthiopicSyllableCchhu => ETHIOPIC_SYLLABLE_CCHHU,
EthiopicExtendedA::EthiopicSyllableCchhi => ETHIOPIC_SYLLABLE_CCHHI,
EthiopicExtendedA::EthiopicSyllableCchhaa => ETHIOPIC_SYLLABLE_CCHHAA,
EthiopicExtendedA::EthiopicSyllableCchhee => ETHIOPIC_SYLLABLE_CCHHEE,
EthiopicExtendedA::EthiopicSyllableCchhe => ETHIOPIC_SYLLABLE_CCHHE,
EthiopicExtendedA::EthiopicSyllableCchho => ETHIOPIC_SYLLABLE_CCHHO,
EthiopicExtendedA::EthiopicSyllableBba => ETHIOPIC_SYLLABLE_BBA,
EthiopicExtendedA::EthiopicSyllableBbu => ETHIOPIC_SYLLABLE_BBU,
EthiopicExtendedA::EthiopicSyllableBbi => ETHIOPIC_SYLLABLE_BBI,
EthiopicExtendedA::EthiopicSyllableBbaa => ETHIOPIC_SYLLABLE_BBAA,
EthiopicExtendedA::EthiopicSyllableBbee => ETHIOPIC_SYLLABLE_BBEE,
EthiopicExtendedA::EthiopicSyllableBbe => ETHIOPIC_SYLLABLE_BBE,
EthiopicExtendedA::EthiopicSyllableBbo => ETHIOPIC_SYLLABLE_BBO,
}
}
}
impl std::convert::TryFrom<char> for EthiopicExtendedA {
type Error = ();
fn try_from(c: char) -> Result<Self, Self::Error> {
use constants::*;
match c {
ETHIOPIC_SYLLABLE_TTHU => Ok(EthiopicExtendedA::EthiopicSyllableTthu),
ETHIOPIC_SYLLABLE_TTHI => Ok(EthiopicExtendedA::EthiopicSyllableTthi),
ETHIOPIC_SYLLABLE_TTHAA => Ok(EthiopicExtendedA::EthiopicSyllableTthaa),
ETHIOPIC_SYLLABLE_TTHEE => Ok(EthiopicExtendedA::EthiopicSyllableTthee),
ETHIOPIC_SYLLABLE_TTHE => Ok(EthiopicExtendedA::EthiopicSyllableTthe),
ETHIOPIC_SYLLABLE_TTHO => Ok(EthiopicExtendedA::EthiopicSyllableTtho),
ETHIOPIC_SYLLABLE_DDHU => Ok(EthiopicExtendedA::EthiopicSyllableDdhu),
ETHIOPIC_SYLLABLE_DDHI => Ok(EthiopicExtendedA::EthiopicSyllableDdhi),
ETHIOPIC_SYLLABLE_DDHAA => Ok(EthiopicExtendedA::EthiopicSyllableDdhaa),
ETHIOPIC_SYLLABLE_DDHEE => Ok(EthiopicExtendedA::EthiopicSyllableDdhee),
ETHIOPIC_SYLLABLE_DDHE => Ok(EthiopicExtendedA::EthiopicSyllableDdhe),
ETHIOPIC_SYLLABLE_DDHO => Ok(EthiopicExtendedA::EthiopicSyllableDdho),
ETHIOPIC_SYLLABLE_DZU => Ok(EthiopicExtendedA::EthiopicSyllableDzu),
ETHIOPIC_SYLLABLE_DZI => Ok(EthiopicExtendedA::EthiopicSyllableDzi),
ETHIOPIC_SYLLABLE_DZAA => Ok(EthiopicExtendedA::EthiopicSyllableDzaa),
ETHIOPIC_SYLLABLE_DZEE => Ok(EthiopicExtendedA::EthiopicSyllableDzee),
ETHIOPIC_SYLLABLE_DZE => Ok(EthiopicExtendedA::EthiopicSyllableDze),
ETHIOPIC_SYLLABLE_DZO => Ok(EthiopicExtendedA::EthiopicSyllableDzo),
ETHIOPIC_SYLLABLE_CCHHA => Ok(EthiopicExtendedA::EthiopicSyllableCchha),
ETHIOPIC_SYLLABLE_CCHHU => Ok(EthiopicExtendedA::EthiopicSyllableCchhu),
ETHIOPIC_SYLLABLE_CCHHI => Ok(EthiopicExtendedA::EthiopicSyllableCchhi),
ETHIOPIC_SYLLABLE_CCHHAA => Ok(EthiopicExtendedA::EthiopicSyllableCchhaa),
ETHIOPIC_SYLLABLE_CCHHEE => Ok(EthiopicExtendedA::EthiopicSyllableCchhee),
ETHIOPIC_SYLLABLE_CCHHE => Ok(EthiopicExtendedA::EthiopicSyllableCchhe),
ETHIOPIC_SYLLABLE_CCHHO => Ok(EthiopicExtendedA::EthiopicSyllableCchho),
ETHIOPIC_SYLLABLE_BBA => Ok(EthiopicExtendedA::EthiopicSyllableBba),
ETHIOPIC_SYLLABLE_BBU => Ok(EthiopicExtendedA::EthiopicSyllableBbu),
ETHIOPIC_SYLLABLE_BBI => Ok(EthiopicExtendedA::EthiopicSyllableBbi),
ETHIOPIC_SYLLABLE_BBAA => Ok(EthiopicExtendedA::EthiopicSyllableBbaa),
ETHIOPIC_SYLLABLE_BBEE => Ok(EthiopicExtendedA::EthiopicSyllableBbee),
ETHIOPIC_SYLLABLE_BBE => Ok(EthiopicExtendedA::EthiopicSyllableBbe),
ETHIOPIC_SYLLABLE_BBO => Ok(EthiopicExtendedA::EthiopicSyllableBbo),
_ => Err(()),
}
}
}
impl Into<u32> for EthiopicExtendedA {
fn into(self) -> u32 {
let c: char = self.into();
let hex = c
.escape_unicode()
.to_string()
.replace("\\u{", "")
.replace("}", "");
u32::from_str_radix(&hex, 16).unwrap()
}
}
impl std::convert::TryFrom<u32> for EthiopicExtendedA {
type Error = ();
fn try_from(u: u32) -> Result<Self, Self::Error> {
if let Ok(c) = char::try_from(u) {
Self::try_from(c)
} else {
Err(())
}
}
}
impl Iterator for EthiopicExtendedA {
type Item = Self;
fn next(&mut self) -> Option<Self> {
let index: u32 = (*self).into();
use std::convert::TryFrom;
Self::try_from(index + 1).ok()
}
}
impl EthiopicExtendedA {
pub fn new() -> Self {
EthiopicExtendedA::EthiopicSyllableTthu
}
pub fn name(&self) -> &str {
match self {
EthiopicExtendedA::EthiopicSyllableTthu => "ethiopic syllable tthu",
EthiopicExtendedA::EthiopicSyllableTthi => "ethiopic syllable tthi",
EthiopicExtendedA::EthiopicSyllableTthaa => "ethiopic syllable tthaa",
EthiopicExtendedA::EthiopicSyllableTthee => "ethiopic syllable tthee",
EthiopicExtendedA::EthiopicSyllableTthe => "ethiopic syllable tthe",
EthiopicExtendedA::EthiopicSyllableTtho => "ethiopic syllable ttho",
EthiopicExtendedA::EthiopicSyllableDdhu => "ethiopic syllable ddhu",
EthiopicExtendedA::EthiopicSyllableDdhi => "ethiopic syllable ddhi",
EthiopicExtendedA::EthiopicSyllableDdhaa => "ethiopic syllable ddhaa",
EthiopicExtendedA::EthiopicSyllableDdhee => "ethiopic syllable ddhee",
EthiopicExtendedA::EthiopicSyllableDdhe => "ethiopic syllable ddhe",
EthiopicExtendedA::EthiopicSyllableDdho => "ethiopic syllable ddho",
EthiopicExtendedA::EthiopicSyllableDzu => "ethiopic syllable dzu",
EthiopicExtendedA::EthiopicSyllableDzi => "ethiopic syllable dzi",
EthiopicExtendedA::EthiopicSyllableDzaa => "ethiopic syllable dzaa",
EthiopicExtendedA::EthiopicSyllableDzee => "ethiopic syllable dzee",
EthiopicExtendedA::EthiopicSyllableDze => "ethiopic syllable dze",
EthiopicExtendedA::EthiopicSyllableDzo => "ethiopic syllable dzo",
EthiopicExtendedA::EthiopicSyllableCchha => "ethiopic syllable cchha",
EthiopicExtendedA::EthiopicSyllableCchhu => "ethiopic syllable cchhu",
EthiopicExtendedA::EthiopicSyllableCchhi => "ethiopic syllable cchhi",
EthiopicExtendedA::EthiopicSyllableCchhaa => "ethiopic syllable cchhaa",
EthiopicExtendedA::EthiopicSyllableCchhee => "ethiopic syllable cchhee",
EthiopicExtendedA::EthiopicSyllableCchhe => "ethiopic syllable cchhe",
EthiopicExtendedA::EthiopicSyllableCchho => "ethiopic syllable cchho",
EthiopicExtendedA::EthiopicSyllableBba => "ethiopic syllable bba",
EthiopicExtendedA::EthiopicSyllableBbu => "ethiopic syllable bbu",
EthiopicExtendedA::EthiopicSyllableBbi => "ethiopic syllable bbi",
EthiopicExtendedA::EthiopicSyllableBbaa => "ethiopic syllable bbaa",
EthiopicExtendedA::EthiopicSyllableBbee => "ethiopic syllable bbee",
EthiopicExtendedA::EthiopicSyllableBbe => "ethiopic syllable bbe",
EthiopicExtendedA::EthiopicSyllableBbo => "ethiopic syllable bbo",
}
}
}