Skip to content

Commit 0d47389

Browse files
authored
Merge pull request #917 from PyThaiNLP/fix-maiyamok
Fixed #914
2 parents e034c54 + 51d3639 commit 0d47389

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pythainlp/util/normalize.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,12 @@ def maiyamok(sent: Union[str, List[str]]) -> List[str]:
283283
if "ๆ" == text:
284284
text = _list_word[i - 1]
285285
elif "ๆ" in text:
286-
text = text.replace("ๆ", "")
287-
_list_word.append(text)
286+
count = text.count("ๆ")
287+
text = _list_word[i - 1]
288+
for _ in range(count):
289+
_list_word.append(text)
288290
i += 1
291+
continue
289292
_list_word.append(text)
290293
i += 1
291294
return _list_word

0 commit comments

Comments
 (0)