diff options
Diffstat (limited to 'library/src')
| -rw-r--r-- | library/src/meta/numbering.rs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/library/src/meta/numbering.rs b/library/src/meta/numbering.rs index 7ba27aaa..fbe7306c 100644 --- a/library/src/meta/numbering.rs +++ b/library/src/meta/numbering.rs @@ -38,7 +38,7 @@ pub fn numbering( /// Defines how the numbering works. /// /// **Counting symbols** are `1`, `a`, `A`, `i`, `I`, `い`, `イ`, - /// `א`, and `*`. They are replaced by the number in the sequence, + /// `א`, `가`, `ㄱ`, and `*`. They are replaced by the number in the sequence, /// in the given case. /// /// The `*` character means that symbols should be used to count, in the @@ -132,7 +132,7 @@ cast_to_value! { /// How to turn a number into text. /// /// A pattern consists of a prefix, followed by one of `1`, `a`, `A`, `i`, -/// `I`, `い`, `イ`, `א`, or `*`, and then a suffix. +/// `I`, `い`, `イ`, `א`, `가`, `ㄱ`, or `*`, and then a suffix. /// /// Examples of valid patterns: /// - `1)` @@ -269,6 +269,8 @@ enum NumberingKind { TraditionalChinese, HiraganaIroha, KatakanaIroha, + KoreanJamo, + KoreanSyllable, } impl NumberingKind { @@ -283,6 +285,8 @@ impl NumberingKind { '一' | '壹' => NumberingKind::SimplifiedChinese, 'い' => NumberingKind::HiraganaIroha, 'イ' => NumberingKind::KatakanaIroha, + 'ㄱ' => NumberingKind::KoreanJamo, + '가' => NumberingKind::KoreanSyllable, _ => return None, }) } @@ -299,6 +303,8 @@ impl NumberingKind { Self::TraditionalChinese => '一', Self::HiraganaIroha => 'い', Self::KatakanaIroha => 'イ', + Self::KoreanJamo => 'ㄱ', + Self::KoreanSyllable => '가', } } @@ -464,6 +470,24 @@ impl NumberingKind { Err(_) => '-'.into(), } } + Self::KoreanJamo => zeroless::<14>( + |x| { + [ + 'ㄱ', 'ㄴ', 'ㄷ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅅ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', + 'ㅌ', 'ㅍ', 'ㅎ', + ][x] + }, + n, + ), + Self::KoreanSyllable => zeroless::<14>( + |x| { + [ + '가', '나', '다', '라', '마', '바', '사', '아', '자', '차', '카', + '타', '파', '하', + ][x] + }, + n, + ), } } } |
