Commit 41ed2c8
Fix check_marttra() Thai final consonant classification (#1173)
* Initial plan
* Fix check_marttra function to handle Thai final consonants correctly
- Fixed handle_karun_sound_silence to correctly remove only silent consonants marked by ์
- Fixed handling of ำ at the end to return กม (not กา)
- Fixed handling of consonant clusters with ร (e.g., กร, ขร, คร) in compound words
- Fixed handling of words with ไ/ใ vowels to distinguish true final consonants ย/ล from vowel components
- Fixed typo in consonant list (", ณ" -> "ณ")
- Uncommented all previously failing test cases
Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>
* Address code review feedback
- Remove duplicate ล from กน consonant list (already classified as เกย on line 282)
- Use imported thai_consonants constant instead of duplicating the string
- Improves code maintainability and eliminates redundancy
Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>
* Optimize helper function by moving to class method
- Moved has_true_final_yl from inline function to class method _has_true_final_yl
- Avoids recreating function object on every check_marttra call
- Improves performance and code organization
Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>1 parent 0264e67 commit 41ed2c8
2 files changed
+60
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
19 | 36 | | |
20 | 37 | | |
21 | 38 | | |
| |||
223 | 240 | | |
224 | 241 | | |
225 | 242 | | |
226 | | - | |
227 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
228 | 253 | | |
229 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
230 | 270 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 271 | + | |
235 | 272 | | |
236 | 273 | | |
237 | 274 | | |
| |||
245 | 282 | | |
246 | 283 | | |
247 | 284 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
252 | 288 | | |
253 | 289 | | |
254 | 290 | | |
| |||
272 | 308 | | |
273 | 309 | | |
274 | 310 | | |
275 | | - | |
| 311 | + | |
276 | 312 | | |
277 | 313 | | |
278 | 314 | | |
| |||
649 | 685 | | |
650 | 686 | | |
651 | 687 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
657 | 691 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
0 commit comments