Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/khavee.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
)
)
# -> [
# "Cant find rhyme between paragraphs ('สอน', 'ไป') in paragraph 4",
# "Cant find rhyme between paragraphs ('มี่', ['เกม', 'เอ่อ', 'เก่ง', 'กาจ']) in paragraph 5"
# "Can't find rhyme between paragraphs ('สอน', 'ไป') in paragraph 4",
# "Can't find rhyme between paragraphs ('มี่', ['เกม', 'เอ่อ', 'เก่ง', 'กาจ']) in paragraph 5"
# ]


Expand All @@ -95,8 +95,8 @@
)
)
# -> [
# "Cant find rhyme between paragraphs ('หมา', 'จอง') in paragraph 2",
# "Cant find rhyme between paragraphs ('หมา', 'ทอง') in paragraph 2"
# "Can't find rhyme between paragraphs ('หมา', 'จอง') in paragraph 2",
# "Can't find rhyme between paragraphs ('หมา', 'ทอง') in paragraph 2"
# ]

# การเช็คคำเอกโท
Expand Down
2 changes: 1 addition & 1 deletion pythainlp/khavee/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def check_marttra(self, word: str) -> str:
if "็" in word:
return "กา"
else:
return "Cant find Marttra in this word"
return "Can't find Marttra in this word"

def is_sumpus(self, word1: str, word2: str) -> bool:
"""
Expand Down
8 changes: 4 additions & 4 deletions pythainlp/phayathaibert/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def rm_brackets(self, text: str) -> str:
:return: text where all useless brackets are removed
:rtype: str
:Example:
>>> rm_brackets("hey() whats[;] up{*&} man(hey)")
hey whats up man(hey)
>>> rm_brackets("hey() what's[;] up{*&} man(hey)")
hey what's up man(hey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this. this is function input and output examples, do not modify.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in commit 7e79219. The docstring examples now show the original "whats" to correctly demonstrate the function's input/output behavior.

"""
# remove empty brackets
new_line = re.sub(r"\(\)", "", text)
Expand All @@ -76,8 +76,8 @@ def replace_newlines(self, text: str) -> str:
:return: text where all newlines are replaced with spaces
:rtype: str
:Example:
>>> rm_useless_spaces("hey whats\n\nup")
hey whats up
>>> rm_useless_spaces("hey what's\n\nup")
hey what's up
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this. this is function input and output examples, do not modify.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in commit 7e79219. The docstring examples now show the original "whats" to correctly demonstrate the function's input/output behavior.

"""
return re.sub(r"[\n]", " ", text.strip())

Expand Down
2 changes: 1 addition & 1 deletion pythainlp/transliterate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def romanize(

:param str text: A Thai word to be romanized. \
The input should not include whitespace because \
the function is support subwords by spliting whitespace.
the function is support subwords by splitting whitespace.
:param str engine: One of 'royin' (default), 'thai2rom', 'thai2rom_onnx,
'tltk', and 'lookup'. See more in options for engine section.
:param str fallback_engine: If engine equals 'lookup',
Expand Down
2 changes: 1 addition & 1 deletion pythainlp/transliterate/iso_11940.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

_punctuation_and_digits = {
# ฯ can has two meanings in ISO 11940.
# If it is for abbrevation, it is paiyan noi.
# If it is for abbreviation, it is paiyan noi.
# If it is for sentence termination, it is angkhan diao.
# Without semantic analysis, they cannot be distinguished from each other.
# In this simple implementation, we decided to always treat ฯ as paiyan noi.
Expand Down
4 changes: 2 additions & 2 deletions pythainlp/util/remove_trailing_repeat_consonants.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def remove_trailing_repeat_consonants(
if has_dictionary_updated:
_update_consonant_repeaters(custom_dict)

# seperate by newline
# separate by newline
modified_lines = []
for line in text.split("\n"):
segments = line.split(" ")
Expand Down Expand Up @@ -144,7 +144,7 @@ def _remove_repeat_trailing_consonants_from_segment(segment: str) -> str:
# the chance is that the correct is one character,
# or it's not in the dictionary.

# make the repition to once
# make the repetition to once
segment = segment_head + (dup * 1)

return segment
Expand Down
Loading