From 51d3639903eacc696a1473dfce3fb6c6947eb26b Mon Sep 17 00:00:00 2001 From: Wannaphong Phatthiyaphaibun Date: Wed, 29 May 2024 22:55:56 +0700 Subject: [PATCH] Fixed #914 --- pythainlp/util/normalize.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pythainlp/util/normalize.py b/pythainlp/util/normalize.py index 3276e6e8d..bee233afe 100644 --- a/pythainlp/util/normalize.py +++ b/pythainlp/util/normalize.py @@ -283,9 +283,12 @@ def maiyamok(sent: Union[str, List[str]]) -> List[str]: if "ๆ" == text: text = _list_word[i - 1] elif "ๆ" in text: - text = text.replace("ๆ", "") - _list_word.append(text) + count = text.count("ๆ") + text = _list_word[i - 1] + for _ in range(count): + _list_word.append(text) i += 1 + continue _list_word.append(text) i += 1 return _list_word