Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Added
- Garay numeral system
- Medefaidrin numeral system
## [1.4] - 2026-02-16
### Added
- Ahom numeral system
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ It can automatically detect mixed numeral formats in a piece of text and convert
- Tamil ★
- Pahawh Hmong
- Garay
- Medefaidrin

> ★ Non-positional numeral system

Expand Down
5 changes: 4 additions & 1 deletion tests/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
NumeralSystem.WANCHO,
NumeralSystem.DIVES_AKURU,
NumeralSystem.GARAY,
NumeralSystem.NYIAKENG_PUACHUE_HMONG]
NumeralSystem.NYIAKENG_PUACHUE_HMONG,
NumeralSystem.MEDEFAIDRIN,
]

CONVERSION_CASES = {
NumeralSystem.ARABIC_INDIC: "٠١٢٣٤٥٦٧٨٩",
Expand Down Expand Up @@ -96,6 +98,7 @@
NumeralSystem.TAMIL: "௦௧௨௩௪௫௬௭௮௯",
NumeralSystem.PAHAWH_HMONG: "𖭐𖭑𖭒𖭓𖭔𖭕𖭖𖭗𖭘𖭙",
NumeralSystem.GARAY: "𐵀𐵁𐵂𐵃𐵄𐵅𐵆𐵇𐵈𐵉",
NumeralSystem.MEDEFAIDRIN: "𖺀𖺁𖺂𖺃𖺄𖺅𖺆𖺇𖺈𖺉",
}

def test_numeral_system_length():
Expand Down
3 changes: 3 additions & 0 deletions xnum/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
TAMIL_DIGITS = ['௦', '௧', '௨', '௩', '௪', '௫', '௬', '௭', '௮', '௯']
PAHAWH_HMONG_DIGITS = ['𖭐', '𖭑', '𖭒', '𖭓', '𖭔', '𖭕', '𖭖', '𖭗', '𖭘', '𖭙']
GARAY_DIGITS = ['𐵀', '𐵁', '𐵂', '𐵃', '𐵄', '𐵅', '𐵆', '𐵇', '𐵈', '𐵉']
MEDEFAIDRIN_DIGITS = ['𖺀', '𖺁', '𖺂', '𖺃', '𖺄', '𖺅', '𖺆', '𖺇', '𖺈', '𖺉']

NUMERAL_MAPS = {
"english": ENGLISH_DIGITS,
Expand Down Expand Up @@ -156,6 +157,7 @@
"tamil": TAMIL_DIGITS,
"pahawh_hmong": PAHAWH_HMONG_DIGITS,
"garay": GARAY_DIGITS,
"medefaidrin": MEDEFAIDRIN_DIGITS,
}

ALL_DIGIT_MAPS = {}
Expand Down Expand Up @@ -242,6 +244,7 @@ class NumeralSystem(Enum):
TAMIL = "tamil"
PAHAWH_HMONG = "pahawh_hmong"
GARAY = "garay"
MEDEFAIDRIN = "medefaidrin"
AUTO = "auto"


Expand Down
Loading