Skip to content

Commit 5e915bf

Browse files
committed
add rule in pythainlp.util.normalize
1 parent b50275a commit 5e915bf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pythainlp/util/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@ def trigram(token):
5151
(u"ํ(t)า",u"\\1ำ"),
5252
(u"ํา(t)",u"\\1ำ"),
5353
(u"([่-๋])([ัิ-ื])",u"\\2\\1"),
54-
(u"ำ([่-๋])", u"\\1ำ")]
54+
(u"ำ([่-๋])", u"\\1ำ"),
55+
(u"([่-๋])([ูุ])", u"\\2\\1")
56+
]
5557
rule2py2=[
5658
(u"เเ",u"แ"),
5759
(u"ํ(t)า",u"\1ำ"),
5860
(u"ํา(t)",u"\1ำ"),
5961
(u"([่-๋])([ัิ-ื])",u"\2\1"),
60-
(u"ำ([่-๋])", u"\1ำ")
62+
(u"ำ([่-๋])", u"\1ำ"),
63+
(u"([่-๋])([ูุ])", u"\2\1")
6164
] # เก็บพวก พิมพ์ลำดับผิดหรือผิดแป้นแต่กลับแสดงผลถูกต้อง ให้ไปเป็นแป้นที่ถูกต้อง เช่น เ + เ ไปเป็น แ
6265
def normalize(text):
6366
"""

0 commit comments

Comments
 (0)