Skip to content

bug: check_marttra("จักร") returns "กน" #966

@bact

Description

@bact

Description

check_marttra() method in pythainlp.khavee.KhaveeVerifier does not properly handel "กร" as a final consonant.

Expected results

check_marttra("จักร") returns "กก"

Current results

check_marttra("จักร") returns "กน"

See a run in PR #967 at https://github.com/PyThaiNLP/pythainlp/actions/runs/11641064036/job/32419112079?pr=967

Steps to reproduce

from pythainlp.khavee import KhaveeVerifier

kv = KhaveeVerifier()

kv.check_marttra("จักร")

PyThaiNLP version

5.0.4

More cases

All of these following test cases at

def test_check_marttra(self):
are failed.

        self.assertEqual(kv.check_marttra("ขำ"), "กม")
        self.assertEqual(kv.check_marttra("รมย์"), "กม")

        self.assertEqual(kv.check_marttra("ทัย"), "เกย")
        self.assertEqual(kv.check_marttra("ไทย"), "เกย")
        self.assertEqual(kv.check_marttra("ไกล"), "เกย")
        self.assertEqual(kv.check_marttra("ใกล้"), "เกย")

        self.assertEqual(kv.check_marttra("จักร"), "กก")

        self.assertEqual(kv.check_marttra("โยชน์"), "กด")

        self.assertEqual(kv.check_marttra("ยนต์"), "กน")
        self.assertEqual(kv.check_marttra("กรรณ"), "กน")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbugs in the libraryhelp wantedno contributor yet

    Type

    No type

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions