#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub enum SupplementalPunctuation {
RightAngleSubstitutionMarker,
RightAngleDottedSubstitutionMarker,
LeftSubstitutionBracket,
RightSubstitutionBracket,
LeftDottedSubstitutionBracket,
RightDottedSubstitutionBracket,
RaisedInterpolationMarker,
RaisedDottedInterpolationMarker,
DottedTranspositionMarker,
LeftTranspositionBracket,
RightTranspositionBracket,
RaisedSquare,
LeftRaisedOmissionBracket,
RightRaisedOmissionBracket,
EditorialCoronis,
Paragraphos,
ForkedParagraphos,
ReversedForkedParagraphos,
Hypodiastole,
DottedObelos,
DownwardsAncora,
UpwardsAncora,
DottedRightDashPointingAngle,
DoubleObliqueHyphen,
InvertedInterrobang,
PalmBranch,
HyphenWithDiaeresis,
TildeWithRingAbove,
LeftLowParaphraseBracket,
RightLowParaphraseBracket,
TildeWithDotAbove,
TildeWithDotBelow,
LeftVerticalBarWithQuill,
RightVerticalBarWithQuill,
TopLeftHalfBracket,
TopRightHalfBracket,
BottomLeftHalfBracket,
BottomRightHalfBracket,
LeftSidewaysUBracket,
RightSidewaysUBracket,
LeftDoubleParenthesis,
RightDoubleParenthesis,
TwoDotsOverOneDotPunctuation,
OneDotOverTwoDotsPunctuation,
SquaredFourDotPunctuation,
FiveDotMark,
ReversedQuestionMark,
VerticalTilde,
RingPoint,
WordSeparatorMiddleDot,
TurnedComma,
RaisedDot,
RaisedComma,
TurnedSemicolon,
DaggerWithLeftGuard,
DaggerWithRightGuard,
TurnedDagger,
TopHalfSectionSign,
TwoDashEmDash,
ThreeDashEmDash,
StenographicFullStop,
VerticalSixDots,
WigglyVerticalLine,
Capitulum,
DoubleHyphen,
ReversedComma,
DoubleLowDashReversedDash9QuotationMark,
DashWithLeftUpturn,
DoubleSuspensionMark,
InvertedLowKavyka,
InvertedLowKavykaWithKavykaAbove,
LowKavyka,
LowKavykaWithDot,
DoubleStackedComma,
DottedSolidus,
TripleDagger,
MedievalComma,
ParagraphusMark,
PunctusElevatusMark,
CornishVerseDivider,
}
impl Into<char> for SupplementalPunctuation {
fn into(self) -> char {
match self {
SupplementalPunctuation::RightAngleSubstitutionMarker => '⸀',
SupplementalPunctuation::RightAngleDottedSubstitutionMarker => '⸁',
SupplementalPunctuation::LeftSubstitutionBracket => '⸂',
SupplementalPunctuation::RightSubstitutionBracket => '⸃',
SupplementalPunctuation::LeftDottedSubstitutionBracket => '⸄',
SupplementalPunctuation::RightDottedSubstitutionBracket => '⸅',
SupplementalPunctuation::RaisedInterpolationMarker => '⸆',
SupplementalPunctuation::RaisedDottedInterpolationMarker => '⸇',
SupplementalPunctuation::DottedTranspositionMarker => '⸈',
SupplementalPunctuation::LeftTranspositionBracket => '⸉',
SupplementalPunctuation::RightTranspositionBracket => '⸊',
SupplementalPunctuation::RaisedSquare => '⸋',
SupplementalPunctuation::LeftRaisedOmissionBracket => '⸌',
SupplementalPunctuation::RightRaisedOmissionBracket => '⸍',
SupplementalPunctuation::EditorialCoronis => '⸎',
SupplementalPunctuation::Paragraphos => '⸏',
SupplementalPunctuation::ForkedParagraphos => '⸐',
SupplementalPunctuation::ReversedForkedParagraphos => '⸑',
SupplementalPunctuation::Hypodiastole => '⸒',
SupplementalPunctuation::DottedObelos => '⸓',
SupplementalPunctuation::DownwardsAncora => '⸔',
SupplementalPunctuation::UpwardsAncora => '⸕',
SupplementalPunctuation::DottedRightDashPointingAngle => '⸖',
SupplementalPunctuation::DoubleObliqueHyphen => '⸗',
SupplementalPunctuation::InvertedInterrobang => '⸘',
SupplementalPunctuation::PalmBranch => '⸙',
SupplementalPunctuation::HyphenWithDiaeresis => '⸚',
SupplementalPunctuation::TildeWithRingAbove => '⸛',
SupplementalPunctuation::LeftLowParaphraseBracket => '⸜',
SupplementalPunctuation::RightLowParaphraseBracket => '⸝',
SupplementalPunctuation::TildeWithDotAbove => '⸞',
SupplementalPunctuation::TildeWithDotBelow => '⸟',
SupplementalPunctuation::LeftVerticalBarWithQuill => '⸠',
SupplementalPunctuation::RightVerticalBarWithQuill => '⸡',
SupplementalPunctuation::TopLeftHalfBracket => '⸢',
SupplementalPunctuation::TopRightHalfBracket => '⸣',
SupplementalPunctuation::BottomLeftHalfBracket => '⸤',
SupplementalPunctuation::BottomRightHalfBracket => '⸥',
SupplementalPunctuation::LeftSidewaysUBracket => '⸦',
SupplementalPunctuation::RightSidewaysUBracket => '⸧',
SupplementalPunctuation::LeftDoubleParenthesis => '⸨',
SupplementalPunctuation::RightDoubleParenthesis => '⸩',
SupplementalPunctuation::TwoDotsOverOneDotPunctuation => '⸪',
SupplementalPunctuation::OneDotOverTwoDotsPunctuation => '⸫',
SupplementalPunctuation::SquaredFourDotPunctuation => '⸬',
SupplementalPunctuation::FiveDotMark => '⸭',
SupplementalPunctuation::ReversedQuestionMark => '⸮',
SupplementalPunctuation::VerticalTilde => 'ⸯ',
SupplementalPunctuation::RingPoint => '⸰',
SupplementalPunctuation::WordSeparatorMiddleDot => '⸱',
SupplementalPunctuation::TurnedComma => '⸲',
SupplementalPunctuation::RaisedDot => '⸳',
SupplementalPunctuation::RaisedComma => '⸴',
SupplementalPunctuation::TurnedSemicolon => '⸵',
SupplementalPunctuation::DaggerWithLeftGuard => '⸶',
SupplementalPunctuation::DaggerWithRightGuard => '⸷',
SupplementalPunctuation::TurnedDagger => '⸸',
SupplementalPunctuation::TopHalfSectionSign => '⸹',
SupplementalPunctuation::TwoDashEmDash => '⸺',
SupplementalPunctuation::ThreeDashEmDash => '⸻',
SupplementalPunctuation::StenographicFullStop => '⸼',
SupplementalPunctuation::VerticalSixDots => '⸽',
SupplementalPunctuation::WigglyVerticalLine => '⸾',
SupplementalPunctuation::Capitulum => '⸿',
SupplementalPunctuation::DoubleHyphen => '⹀',
SupplementalPunctuation::ReversedComma => '⹁',
SupplementalPunctuation::DoubleLowDashReversedDash9QuotationMark => '⹂',
SupplementalPunctuation::DashWithLeftUpturn => '⹃',
SupplementalPunctuation::DoubleSuspensionMark => '⹄',
SupplementalPunctuation::InvertedLowKavyka => '⹅',
SupplementalPunctuation::InvertedLowKavykaWithKavykaAbove => '⹆',
SupplementalPunctuation::LowKavyka => '⹇',
SupplementalPunctuation::LowKavykaWithDot => '⹈',
SupplementalPunctuation::DoubleStackedComma => '⹉',
SupplementalPunctuation::DottedSolidus => '⹊',
SupplementalPunctuation::TripleDagger => '⹋',
SupplementalPunctuation::MedievalComma => '⹌',
SupplementalPunctuation::ParagraphusMark => '⹍',
SupplementalPunctuation::PunctusElevatusMark => '⹎',
SupplementalPunctuation::CornishVerseDivider => '⹏',
}
}
}
impl std::convert::TryFrom<char> for SupplementalPunctuation {
type Error = ();
fn try_from(c: char) -> Result<Self, Self::Error> {
match c {
'⸀' => Ok(SupplementalPunctuation::RightAngleSubstitutionMarker),
'⸁' => Ok(SupplementalPunctuation::RightAngleDottedSubstitutionMarker),
'⸂' => Ok(SupplementalPunctuation::LeftSubstitutionBracket),
'⸃' => Ok(SupplementalPunctuation::RightSubstitutionBracket),
'⸄' => Ok(SupplementalPunctuation::LeftDottedSubstitutionBracket),
'⸅' => Ok(SupplementalPunctuation::RightDottedSubstitutionBracket),
'⸆' => Ok(SupplementalPunctuation::RaisedInterpolationMarker),
'⸇' => Ok(SupplementalPunctuation::RaisedDottedInterpolationMarker),
'⸈' => Ok(SupplementalPunctuation::DottedTranspositionMarker),
'⸉' => Ok(SupplementalPunctuation::LeftTranspositionBracket),
'⸊' => Ok(SupplementalPunctuation::RightTranspositionBracket),
'⸋' => Ok(SupplementalPunctuation::RaisedSquare),
'⸌' => Ok(SupplementalPunctuation::LeftRaisedOmissionBracket),
'⸍' => Ok(SupplementalPunctuation::RightRaisedOmissionBracket),
'⸎' => Ok(SupplementalPunctuation::EditorialCoronis),
'⸏' => Ok(SupplementalPunctuation::Paragraphos),
'⸐' => Ok(SupplementalPunctuation::ForkedParagraphos),
'⸑' => Ok(SupplementalPunctuation::ReversedForkedParagraphos),
'⸒' => Ok(SupplementalPunctuation::Hypodiastole),
'⸓' => Ok(SupplementalPunctuation::DottedObelos),
'⸔' => Ok(SupplementalPunctuation::DownwardsAncora),
'⸕' => Ok(SupplementalPunctuation::UpwardsAncora),
'⸖' => Ok(SupplementalPunctuation::DottedRightDashPointingAngle),
'⸗' => Ok(SupplementalPunctuation::DoubleObliqueHyphen),
'⸘' => Ok(SupplementalPunctuation::InvertedInterrobang),
'⸙' => Ok(SupplementalPunctuation::PalmBranch),
'⸚' => Ok(SupplementalPunctuation::HyphenWithDiaeresis),
'⸛' => Ok(SupplementalPunctuation::TildeWithRingAbove),
'⸜' => Ok(SupplementalPunctuation::LeftLowParaphraseBracket),
'⸝' => Ok(SupplementalPunctuation::RightLowParaphraseBracket),
'⸞' => Ok(SupplementalPunctuation::TildeWithDotAbove),
'⸟' => Ok(SupplementalPunctuation::TildeWithDotBelow),
'⸠' => Ok(SupplementalPunctuation::LeftVerticalBarWithQuill),
'⸡' => Ok(SupplementalPunctuation::RightVerticalBarWithQuill),
'⸢' => Ok(SupplementalPunctuation::TopLeftHalfBracket),
'⸣' => Ok(SupplementalPunctuation::TopRightHalfBracket),
'⸤' => Ok(SupplementalPunctuation::BottomLeftHalfBracket),
'⸥' => Ok(SupplementalPunctuation::BottomRightHalfBracket),
'⸦' => Ok(SupplementalPunctuation::LeftSidewaysUBracket),
'⸧' => Ok(SupplementalPunctuation::RightSidewaysUBracket),
'⸨' => Ok(SupplementalPunctuation::LeftDoubleParenthesis),
'⸩' => Ok(SupplementalPunctuation::RightDoubleParenthesis),
'⸪' => Ok(SupplementalPunctuation::TwoDotsOverOneDotPunctuation),
'⸫' => Ok(SupplementalPunctuation::OneDotOverTwoDotsPunctuation),
'⸬' => Ok(SupplementalPunctuation::SquaredFourDotPunctuation),
'⸭' => Ok(SupplementalPunctuation::FiveDotMark),
'⸮' => Ok(SupplementalPunctuation::ReversedQuestionMark),
'ⸯ' => Ok(SupplementalPunctuation::VerticalTilde),
'⸰' => Ok(SupplementalPunctuation::RingPoint),
'⸱' => Ok(SupplementalPunctuation::WordSeparatorMiddleDot),
'⸲' => Ok(SupplementalPunctuation::TurnedComma),
'⸳' => Ok(SupplementalPunctuation::RaisedDot),
'⸴' => Ok(SupplementalPunctuation::RaisedComma),
'⸵' => Ok(SupplementalPunctuation::TurnedSemicolon),
'⸶' => Ok(SupplementalPunctuation::DaggerWithLeftGuard),
'⸷' => Ok(SupplementalPunctuation::DaggerWithRightGuard),
'⸸' => Ok(SupplementalPunctuation::TurnedDagger),
'⸹' => Ok(SupplementalPunctuation::TopHalfSectionSign),
'⸺' => Ok(SupplementalPunctuation::TwoDashEmDash),
'⸻' => Ok(SupplementalPunctuation::ThreeDashEmDash),
'⸼' => Ok(SupplementalPunctuation::StenographicFullStop),
'⸽' => Ok(SupplementalPunctuation::VerticalSixDots),
'⸾' => Ok(SupplementalPunctuation::WigglyVerticalLine),
'⸿' => Ok(SupplementalPunctuation::Capitulum),
'⹀' => Ok(SupplementalPunctuation::DoubleHyphen),
'⹁' => Ok(SupplementalPunctuation::ReversedComma),
'⹂' => Ok(SupplementalPunctuation::DoubleLowDashReversedDash9QuotationMark),
'⹃' => Ok(SupplementalPunctuation::DashWithLeftUpturn),
'⹄' => Ok(SupplementalPunctuation::DoubleSuspensionMark),
'⹅' => Ok(SupplementalPunctuation::InvertedLowKavyka),
'⹆' => Ok(SupplementalPunctuation::InvertedLowKavykaWithKavykaAbove),
'⹇' => Ok(SupplementalPunctuation::LowKavyka),
'⹈' => Ok(SupplementalPunctuation::LowKavykaWithDot),
'⹉' => Ok(SupplementalPunctuation::DoubleStackedComma),
'⹊' => Ok(SupplementalPunctuation::DottedSolidus),
'⹋' => Ok(SupplementalPunctuation::TripleDagger),
'⹌' => Ok(SupplementalPunctuation::MedievalComma),
'⹍' => Ok(SupplementalPunctuation::ParagraphusMark),
'⹎' => Ok(SupplementalPunctuation::PunctusElevatusMark),
'⹏' => Ok(SupplementalPunctuation::CornishVerseDivider),
_ => Err(()),
}
}
}
impl Into<u32> for SupplementalPunctuation {
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 SupplementalPunctuation {
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 SupplementalPunctuation {
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 SupplementalPunctuation {
pub fn new() -> Self {
SupplementalPunctuation::RightAngleSubstitutionMarker
}
pub fn name(&self) -> String {
let s = std::format!("SupplementalPunctuation{:#?}", self);
string_morph::to_sentence_case(&s)
}
}