-
Notifications
You must be signed in to change notification settings - Fork 277
Add: remove_trailing_repeat_consonants() #862
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
Conversation
tested
function to remove consonants เริ่ดดดดดดดด -> เริ่ด implementation + test code written. Test passed
Hello @konbraphat51! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2023-11-13 07:50:03 UTC |
this is the right commit
Hmm... I cannot find more PEP8 error,,, |
pointed out by codacy
"1 file left unchanged." shown
Lint issue of normalize.py solved |
pointed out by codeclimate
Cognitive complexity pointed out by CodeClimate Black used
pointed out by Lint black used
vscode autopep8 and black has been conflicting. So autopep8 cutted
cognitive complexity pointed out by CodeClimate. Black used.
TODO resolved, black used, test passed
Code complexity pointed out by CodeClimate, black used
Okey, Lint problem and CodeClimate problem are basically solved, and the test for this passed. It seems that the code length of a single file is set to 250 lines, but should I separate this method from normalize.py? |
suggested by PyThaiNLP#862 (comment)
seperate + rename
because this PR inplemention seperated from normalize.py
line-length=79
used black line-length=79
|
Sorry. I was meant to say that the existing |
Neat contribution, thank you. I think that's all. I can approve after few suggested fixes above. |
Update responding to method rename
Ok, all done. |
Kudos, SonarCloud Quality Gate passed! |
I have a last minute thought about which name we should go with,
(try to think what it will like in the context of code completion, when ppl type But I will merge this first. Thank you for your contribution. (the test on Windows is now running for 58 minutes and counting, this shouldn't be the norm :( ) |
What does this changes
Add removement method of repeating consonants by dictionary-based method.
How this fixes it
Add pythainlp.utils.remove_repeat_consonant(text, dictionary)
Find words in the dictionary that has repeating consonant at the last, and find the match with the end of the sentence. If there is none, make the repetition to one; if there is, make the repetition to that one.
Fixes #860
Your checklist for this pull request
🚨Please review the guidelines for contributing to this repository.