Skip to content

Commit

Permalink
Update digitconv.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Sep 6, 2022
1 parent 540f572 commit 18f7239
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion laonlp/util/digitconv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# -*- coding: utf-8 -*-
NUMBERS = "໑໒໓໔໕໖໗໘໙໐"
_arabic_numerals = "1234567890"
_pronunciation = [
"ນຶ່ງ",
"ສອງ",
"ສາມ",
"ສີ່",
"ຫ້າ",
"ຫົກ",
"ເຈັດ",
"ແປດ",
"ເກົ້າ",
"ສູນ"
]
_dict_lao_arabic = {
i:j for i,j in zip(list(NUMBERS), list(_arabic_numerals))
}
Expand Down Expand Up @@ -29,4 +41,11 @@ def arabic_digit_to_lao_digit(text: str) -> str:
:return: returns a string of Lao digit
:rtype: str
"""
return text.translate(_arabic_lao_table)
return text.translate(_arabic_lao_table)

def number2lao(numbers: int):
"""
Numbers to La opronunciation
"""
# TODO
return ""

0 comments on commit 18f7239

Please sign in to comment.