Skip to content

Commit

Permalink
Update normalize.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bact authored Nov 1, 2024
1 parent 022ecbd commit f9783d3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pythainlp/util/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ def expand_maiyamok(sent: Union[str, List[str]]) -> List[str]:
Expand Maiyamok.
Maiyamok (ๆ) (Unicode U+0E46) is a Thai character indicating word
repetition. This function preprocesses Thai text by expanding Maiyamok
repetition. This function preprocesses Thai text by replacing
Maiyamok with a word being repeated.
:param Union[str, List[str]] sent: input sentence (list or str)
:return: list of words
Expand All @@ -265,9 +265,9 @@ def expand_maiyamok(sent: Union[str, List[str]]) -> List[str]:
:Example:
::
from pythainlp.util import maiyamok
from pythainlp.util import expand_maiyamok
maiyamok("เด็กๆกิน")
expand_maiyamok("เด็กๆกิน")
# output: ['เด็ก', 'เด็ก', 'กิน']
"""
if isinstance(sent, str):
Expand Down Expand Up @@ -297,8 +297,11 @@ def maiyamok(sent: Union[str, List[str]]) -> List[str]:
"""
Expand Maiyamok.
Please use expand_maiyamok instead.
Maiyamok (ๆ) (Unicode U+0E46) is a Thai character indicating word
repetition. This function preprocesses Thai text by expanding Maiyamok
repetition. This function preprocesses Thai text by replacing
Maiyamok with a word being repeated.
:param Union[str, List[str]] sent: input sentence (list or str)
:return: list of words
Expand All @@ -307,9 +310,9 @@ def maiyamok(sent: Union[str, List[str]]) -> List[str]:
:Example:
::
from pythainlp.util import maiyamok
from pythainlp.util import expand_maiyamok
maiyamok("เด็กๆกิน")
expand_maiyamok("เด็กๆกิน")
# output: ['เด็ก', 'เด็ก', 'กิน']
"""
warn_deprecation(
Expand Down

0 comments on commit f9783d3

Please sign in to comment.