Comparing version 0.2.5 to 0.2.7
@@ -0,1 +1,13 @@ | ||
# ChangeLog | ||
## v0.2.7 | ||
* 关键词抽取支持自定义词典(可选参数)。 | ||
## v0.2.6 | ||
* 修复不同Node版本的兼容性问题,在v0.11.13下测试通过。 | ||
* 支持自定义词典(可选参数)。 | ||
* 增加关键词抽取功能。 | ||
## v0.2.5 | ||
@@ -2,0 +14,0 @@ |
{ | ||
"name": "nodejieba", | ||
"description": "chinese segment for node", | ||
"version": "0.2.5", | ||
"author": "Yanyi Wu <wuyanyi09@gmail.com>", | ||
"version": "0.2.7", | ||
"author": "Yanyi Wu <i@yanyiwu.com>", | ||
"maintainers": [ | ||
"aszxqw <wuyanyi09@gmail.com>" | ||
"Yanyi Wu <i@yanyiwu.com>" | ||
], | ||
@@ -24,9 +24,9 @@ "main": "./index.js", | ||
"dependencies": { | ||
"nan": "~1.2.0" | ||
"nan": "~1.6.1" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
"test": "node test/segment.js && node test/query_segment.js && node test/pos_tagger.js" | ||
"test": "node test/segment.js && node test/query_segment.js && node test/pos_tagger.js && node test/keyword.js" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -9,3 +9,3 @@ [![Build Status](https://travis-ci.org/aszxqw/nodejieba.png?branch=master)](https://travis-ci.org/aszxqw/nodejieba) | ||
## Introduction | ||
## 介绍 | ||
@@ -16,3 +16,3 @@ `NodeJieba`只是[CppJieba]简单包装而成的`node`扩展,用来进行中文分词。 | ||
## Install | ||
## 下载 | ||
@@ -23,3 +23,3 @@ ```sh | ||
因为`npm`速度很慢而且经常因为墙的原因出现莫名其妙的问题,在此强烈建议使用[cnpm],命令如下: | ||
因为`npm`速度很慢而且经常因为墙的原因出现莫名其妙的问题,可以试试使用[cnpm],命令如下: | ||
@@ -30,3 +30,3 @@ ```sh | ||
## Usage | ||
## 用法 | ||
@@ -38,4 +38,4 @@ ### 默认分词算法 | ||
```js | ||
var segment = require("nodejieba"); | ||
segment.loadDict("./node_modules/nodejieba/dict/jieba.dict.utf8", "./node_modules/nodejieba/dict/hmm_model.utf8"); | ||
var nodejieba = require("nodejieba"); | ||
nodejieba.loadDict("./node_modules/nodejieba/dict/jieba.dict.utf8", "./node_modules/nodejieba/dict/hmm_model.utf8", "./node_modules/nodejieba/dict/user.dict.utf8"); | ||
``` | ||
@@ -46,3 +46,3 @@ | ||
```js | ||
var wordList = segment.cutSync("阻塞模式分词"); | ||
var wordList = nodejieba.cutSync("阻塞模式分词"); | ||
if (wordList.constructor == Array) // just for tutorial, this is always be true | ||
@@ -59,3 +59,3 @@ { | ||
```js | ||
segment.cut("非阻塞模式分词", function(wordList) { | ||
nodejieba.cut("非阻塞模式分词", function(wordList) { | ||
wordList.forEach(function(word) { | ||
@@ -72,4 +72,4 @@ console.log(word); | ||
```js | ||
var segment = require("nodejieba"); | ||
segment.queryLoadDict("./node_modules/nodejieba/dict/jieba.dict.utf8", "./node_modules/nodejieba/dict/hmm_model.utf8"); | ||
var nodejieba = require("nodejieba"); | ||
nodejieba.queryLoadDict("./node_modules/nodejieba/dict/jieba.dict.utf8", "./node_modules/nodejieba/dict/hmm_model.utf8", "./node_modules/nodejieba/dict/user.dict.utf8"); | ||
``` | ||
@@ -80,3 +80,3 @@ | ||
```js | ||
var wordList = segment.queryCutSync("阻塞模式分词"); | ||
var wordList = nodejieba.queryCutSync("阻塞模式分词"); | ||
if (wordList.constructor == Array) // just for tutorial, this is always be true | ||
@@ -93,3 +93,3 @@ { | ||
```js | ||
segment.queryCut("非阻塞模式分词", function(wordList) { | ||
nodejieba.queryCut("非阻塞模式分词", function(wordList) { | ||
wordList.forEach(function(word) { | ||
@@ -107,18 +107,22 @@ console.log(word); | ||
## Testing | ||
### 关键词抽取 | ||
在`node v0.10.2`下测试通过 | ||
具体用法可以参考 `test/keyword.js` | ||
## Demo | ||
## 测试 | ||
在`node v0.10.2`, `node v0.11.13`下测试通过。 | ||
## 在线演示 | ||
http://cppjieba-webdemo.herokuapp.com/ | ||
(chrome is suggested) | ||
## Thanks | ||
## 鸣谢 | ||
[Jieba中文分词] | ||
## Author | ||
## 作者 | ||
- aszxqw https://github.com/aszxqw wuyanyi09@gmail.com | ||
- YanyiWu http://yanyiwu.com i@yanyiwu.com | ||
- myl2821 https://github.com/myl2821 myl2821@gmail.com | ||
@@ -125,0 +129,0 @@ |
@@ -1,4 +0,6 @@ | ||
var segment = require("../index.js"); | ||
segment.taggerLoadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8"); | ||
segment.tag("非阻塞的南京市长江大桥", function(tl){ | ||
var nodejieba = require("../index.js"); | ||
// 第三个参数是可选参数 | ||
//nodejieba.taggerLoadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8", "./dict/user.dict.utf8"); | ||
nodejieba.taggerLoadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8"); | ||
nodejieba.tag("非阻塞的南京市长江大桥", function(tl){ | ||
for(var i = 0; i < tl.length; i++) { | ||
@@ -8,3 +10,3 @@ console.log(i + " => " + tl[i]); | ||
}); | ||
var tl = segment.tagSync("阻塞的南京市长江大桥"); | ||
var tl = nodejieba.tagSync("阻塞的南京市长江大桥"); | ||
for(var i = 0; i < tl.length; i++) { | ||
@@ -11,0 +13,0 @@ console.log(i + " == " + tl[i]); |
@@ -1,6 +0,8 @@ | ||
var segment = require("../index.js"); | ||
var nodejieba = require("../index.js"); | ||
// 第三个参数是分词的粒度阈值,当词长大于3时,会进行细粒度的再切割,不填时默认阈值是4。 | ||
segment.queryLoadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8", 3); | ||
// 第四个参数是可选参数。 | ||
// nodejieba.queryLoadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8", 3, "./dict/user.dict.utf8"); | ||
nodejieba.queryLoadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8", 3); | ||
console.log("非阻塞的:"); | ||
segment.queryCut("小明硕士毕业于中国科学院计算所,后在日本京都大学深造", function(tl){ | ||
nodejieba.queryCut("小明硕士毕业于中国科学院计算所,后在日本京都大学深造", function(tl){ | ||
for(var i = 0; i < tl.length; i++) { | ||
@@ -11,3 +13,3 @@ console.log(i + " => " + tl[i]); | ||
console.log("阻塞的:"); | ||
var tl = segment.queryCutSync("小明硕士毕业于中国科学院计算所,后在日本京都大学深造"); | ||
var tl = nodejieba.queryCutSync("小明硕士毕业于中国科学院计算所,后在日本京都大学深造"); | ||
for(var i = 0; i < tl.length; i++) { | ||
@@ -14,0 +16,0 @@ console.log(i + " == " + tl[i]); |
@@ -1,4 +0,6 @@ | ||
var segment = require("../index.js"); | ||
segment.loadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8"); | ||
segment.cut("非阻塞的南京市长江大桥", function(tl){ | ||
var nodejieba = require("../index.js"); | ||
// 第三个参数是可选参数 | ||
// nodejieba.loadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8", "./dict/user.dict.utf8"); | ||
nodejieba.loadDict("./dict/jieba.dict.utf8", "./dict/hmm_model.utf8"); | ||
nodejieba.cut("非阻塞的南京市长江大桥", function(tl){ | ||
for(var i = 0; i < tl.length; i++) { | ||
@@ -8,3 +10,3 @@ console.log(i + " => " + tl[i]); | ||
}); | ||
var tl = segment.cutSync("阻塞的南京市长江大桥"); | ||
var tl = nodejieba.cutSync("阻塞的南京市长江大桥"); | ||
for(var i = 0; i < tl.length; i++) { | ||
@@ -11,0 +13,0 @@ console.log(i + " == " + tl[i]); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
15766096
75
56
123
1
+ Addednan@1.6.2(transitive)
- Removednan@1.2.0(transitive)
Updatednan@~1.6.1