thaiswap

0.0.1 • Public • Published

ThaiSwap

Normalize character order and remove excessive characters. ported from th_normalize in Libthai project to Coffeescirpt. It's help to solve user input with incorrect character order such as มั้ง (ม + -ั + -้ + ง) and ม้ัง (ม + -้ + -ั + ง) is same in Thai language but isn't look same in computer.

Installation

ThaiSwap is available in NPM by using command

npm install thaiswap

or download minified javascript from Github

Usage

ThaiSwap is compatible with Browser and CommonJS

Browser

<script src="path-to-thaiswap-file"></script>
<script>
  var a = "มั้ง";
  var b = "ม้ัง";
  a = ThaiSwap(a);
  b = ThaiSwap(b);
  if(a == b){
    console.log("มั้ง and ม้ัง is same after Normalize order");
  }
</script>

CommonJS

var ThaiSwap = require("thaiswap");
var a = "มั้ง";
var b = "ม้ัง";
a = ThaiSwap(a);
b = ThaiSwap(b);
if(a == b){
  console.log("มั้ง and ม้ัง is same after Normalize order");
}

Ported by

Pakkapon Phongthawee (phongthawee_p@silpakorn.edu)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    0

Package Sidebar

Install

npm i thaiswap

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • pureexe