1.0.12 • Published 4 years ago

thai-typo-check v1.0.12

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

thai-typo-check

utils for check Thai typo

TypeScript

import { thaiTypoCheck, thaiTypoCheckWords } from "thai-typo-check";

const goodSentence = "ฉันอยากกินยำ";
const typoSentence = "ฉันอยากกินผฟใก่ร์";

test("thaiTypoCheck", () => {
  const sentenceIncludesCustomWords = "ฉันอยากกินยำซี้ดพัทยา";

  expect(thaiTypoCheck(goodSentence)).toBe(true);
  expect(thaiTypoCheck(typoSentence)).toBe(false);
  expect(thaiTypoCheck(sentenceIncludesCustomWords, ["ซี้ด", "พัทยา"])).toBe(
    true
  ); // second parameter is the list of custom words
});

test("thaiTypoCheckWords", () => {
  expect(thaiTypoCheckWords(goodSentence)).toBe(undefined);
  expect(thaiTypoCheckWords(typoSentence)).toEqual("ฉัน,อยาก,กิน>>ผฟใก่ร์<<");
});

License

MIT

1.0.11

4 years ago

1.0.12

4 years ago

1.0.10

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago