fix: metasound truncation order, add 4 missing consonants per paper#1384
Open
phoneee wants to merge 1 commit intoPyThaiNLP:devfrom
Open
fix: metasound truncation order, add 4 missing consonants per paper#1384phoneee wants to merge 1 commit intoPyThaiNLP:devfrom
phoneee wants to merge 1 commit intoPyThaiNLP:devfrom
Conversation
…licate Three fixes in soundex module: - Filter karan spaces before truncating to requested length - Add ฏ,ฑ,ถ,ธ to _C2 (dental class, same sound as ท,ด) - Remove duplicate ข in prayut_and_somchaip _C2
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes MetaSound’s implementation to match the referenced paper and resolves a truncation-order bug that produced incorrect codes when karan (์) removal introduced spaces.
Changes:
- Filter out karan-introduced spaces before truncating MetaSound output to the requested length.
- Add ฏ, ฑ, ถ, ธ to MetaSound
_C2consonant group (per Snae & Brückner, 2009). - Remove a duplicate ข in
prayut_and_somchaip._C2and add regression tests for the MetaSound fixes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/core/test_soundex.py | Adds regression tests covering karan-truncation order and the 4 missing _C2 consonants. |
| pythainlp/soundex/prayut_and_somchaip.py | Removes duplicated ข from _C2 (no functional behavior change expected). |
| pythainlp/soundex/metasound.py | Fixes truncation order and expands _C2 to include ฏ, ฑ, ถ, ธ. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What do these changes do
Fix metasound:
_C2per the original paper (Snae & Brückner, 2009, Table p.507)Fixes #1383