nodejieba-fix
Version:
this is a test package,don't download it
122 lines (85 loc) • 3.71 kB
Markdown
[](https://travis-ci.org/yanyiwu/nodejieba)
[](http://yanyiwu.com/)
[](https://github.com/yanyiwu/nodejieba)
[](http://yanyiwu.com/work/2015/06/14/jieba-series-performance-test.html)
[](http://yanyiwu.mit-license.org)
[](https://david-dm.org/yanyiwu/nodejieba)
[](https://david-dm.org/yanyiwu/nodejieba#info=devDependencies)
[](https://www.npmjs.org/package/nodejieba)
[](https://www.npmjs.org/package/nodejieba)
- - -
# NodeJieba [简体中文](README.md)
## Introduction
The Jieba Chinese Word Segmentation Implemented By Node.js .
## Download
```sh
npm install nodejieba
```
Or [cnpm] instead of npm
```sh
npm --registry=http://r.cnpmjs.org install nodejieba
```
## Usage
```js
var nodejieba = require("nodejieba");
var result = nodejieba.cut("南京市长江大桥");
console.log(result);
//["南京市","长江大桥"]
```
See details in [test/demo.js](test/demo.js)
### POS Tagging
```js
var nodejieba = require("nodejieba");
console.log(nodejieba.tag("红掌拨清波"));
//[ { word: '红掌', tag: 'n' },
// { word: '拨', tag: 'v' },
// { word: '清波', tag: 'n' } ]
```
See details in [test/demo.js](test/demo.js)
### Keyword Extractor
```
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](test/demo.js)
## Testing
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`
## Cases
+ [gitbook-plugin-search-pro]
+ [pinyin]
## Performance
It is supposed to be the best in the angle of high performance, because its basic foundation is powered by C++.
## Online Demo
http://cppjieba-webdemo.herokuapp.com/
(chrome is suggested)
## Contact
Email: `i@yanyiwu.com`
QQ: 64162451

## Licens
MIT http://yanyiwu.mit-license.org
## Thanks
- [Jieba]
## Author
- [YanyiWu]
- [contributors]
[由NodeJieba谈谈Node.js异步实现]:http://yanyiwu.com/work/2015/03/21/nodejs-asynchronous-insight.html
[Node.js的C++扩展初体验之NodeJieba]:http://yanyiwu.com/work/2014/02/22/nodejs-cpp-addon-nodejieba.html
[CppJieba]:https://github.com/yanyiwu/cppjieba.git
[cnpm]:http://cnpmjs.org
[Jieba中文分词]:https://github.com/fxsjy/jieba
[Jieba中文分词系列性能评测]:http://yanyiwu.com/work/2015/06/14/jieba-series-performance-test.html
[contributors]:https://github.com/yanyiwu/nodejieba/graphs/contributors
[YanyiWu]:http://yanyiwu.com
[gitbook-plugin-search-pro]:https://plugins.gitbook.com/plugin/search-pro
[pinyin]:https://github.com/hotoo/pinyin