NodeJieba 简体中文
The Jieba Chinese Word Segmentation Implemented By Node.js .
npm install nodejieba
Or cnpm instead of npm
npm --registry=http://r.cnpmjs.org install nodejieba
var nodejieba = require("nodejieba");
var result = nodejieba.cut("南京市长江大桥");
console.log(result);
//["南京市","长江大桥"]
See details in test/demo.js
var nodejieba = require("nodejieba");
console.log(nodejieba.tag("红掌拨清波"));
//[ { word: '红掌', tag: 'n' },
// { word: '拨', tag: 'v' },
// { word: '清波', tag: 'n' } ]
See details in test/demo.js
var nodejieba = require("nodejieba");
var topN = 4;
console.log(nodejieba.extract("升职加薪,当上CEO,走上人生巅峰。", topN));
//[ { word: 'CEO', weight: 11.739204307083542 },
// { word: '升职', weight: 10.8561552143 },
// { word: '加薪', weight: 10.642581114 },
// { word: '巅峰', weight: 9.49395840471 } ]
See details in test/demo.js
Testing passed in the following version:
node v0.10.2
node v0.12.1
iojs v1.3.0
iojs v2.2.1
node v4.0.0
It is supposed to be the best in the angle of high performance, because its basic foundation is powered by C++.
http://cppjieba-webdemo.herokuapp.com/ (chrome is suggested)
Email: [email protected]
QQ: 64162451
MIT http://yanyiwu.mit-license.org
- [Jieba]