node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

wordcut-ts

Wordcut ported to TypeScript

Thai word breaker library for Node.js

Under development ...

Installation

yarn add wordcut-ts

Usage

import { Wordcut } from "wordcut-ts";
 
var wordcut = new Wordcut(); 
wordcut.initNoDict();
 
console.log(wordcut.cut("กากา"));

With additional custom dictionary

wordcut.init("customdict/*.txt" ,true);

Web API

node server.js
curl -X POST --data-binary '{"line":"กากา"}' http://localhost:8882/segment

Development