Skip to content

bug: tone_detector wrongly detect falling tone for ครับ #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
antlossway opened this issue Nov 22, 2024 · 1 comment · Fixed by #1046
Closed

bug: tone_detector wrongly detect falling tone for ครับ #1004

antlossway opened this issue Nov 22, 2024 · 1 comment · Fixed by #1046
Labels
bug bugs in the library

Comments

@antlossway
Copy link

antlossway commented Nov 22, 2024

Description

print(tone_detector("ครับ"))
result: f

print(tone_detector("ค่ะ"))
result: h

Expected results

"ครับ" should be high tone
"ค่ะ" should be falling tone

Current results

"ครับ": falling tone
"ค่ะ": high tone

Steps to reproduce

print(tone_detector("ครับ"))
print(tone_detector("ค่ะ"))

PyThaiNLP version

5.0.4

Python version

3.10.15

Operating system and version

macOS 15.1.1

More info

No response

Possible solution

the falling tone result for "ครับ" is derived from below code block in syllable.py
elif ( initial_consonant_type == "low" and syllable_check_length == "long" and syllable_check == "close" and s == "dead" ): r = "f"

Files

No response

Copy link

Hello @antlossway, thank you for your interest in our work!

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

สวัสดี @antlossway ขอบคุณที่สนใจงานของเรา

ถ้านี่เป็นรายงานข้อผิดพลาด กรุณาแนบภาพหน้าจอ ข้อความแสดงข้อผิดพลาด และ โค้ดที่สั้นที่สุดเท่าที่จะทำให้เกิดปัญหา เพื่อที่เราจะสามารถช่วยเหลือได้

@wannaphong wannaphong added bug bugs in the library help wanted no contributor yet labels Nov 24, 2024
@wannaphong wannaphong removed the help wanted no contributor yet label Dec 25, 2024
@wannaphong wannaphong mentioned this issue Dec 25, 2024
2 tasks
wannaphong added a commit that referenced this issue Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants