Comparing version 2.5.2 to 2.6.0
# NodeJieba ChangeLog | ||
## v2.6.0 | ||
+ Merged [pull request 202](https://github.com/yanyiwu/nodejieba/pull/202) | ||
## v2.5.2 | ||
@@ -4,0 +8,0 @@ |
@@ -47,4 +47,5 @@ var binary = require('@mapbox/node-pre-gyp'); | ||
wrapWithDictLoad("extract"); | ||
wrapWithDictLoad("textRankExtract"); | ||
wrapWithDictLoad("insertWord"); | ||
module.exports = exports; |
{ | ||
"name": "nodejieba", | ||
"description": "chinese word segmentation for node", | ||
"version": "2.5.2", | ||
"version": "2.6.0", | ||
"author": "Yanyi Wu <i@yanyiwu.com>", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
@@ -98,2 +98,9 @@ [![Build Status](https://travis-ci.org/yanyiwu/nodejieba.png?branch=master)](https://travis-ci.org/yanyiwu/nodejieba) | ||
// { word: '巅峰', weight: 9.49395840471 } ] | ||
console.log(nodejieba.textRankExtract("升职加薪,当上CEO,走上人生巅峰。", topN)); | ||
//[ { word: '当上', weight: 1 }, | ||
// { word: '不用', weight: 0.9898479330698993 }, | ||
// { word: '多久', weight: 0.9851260595435759 }, | ||
// { word: '加薪', weight: 0.9830464899847804 }, | ||
// { word: '升职', weight: 0.9802777682279076 } ] | ||
``` | ||
@@ -100,0 +107,0 @@ |
@@ -123,2 +123,9 @@ [![Build Status](https://travis-ci.org/yanyiwu/nodejieba.png?branch=master)](https://travis-ci.org/yanyiwu/nodejieba) | ||
// { word: '巅峰', weight: 9.49395840471 } ] | ||
console.log(nodejieba.textRankExtract("升职加薪,当上CEO,走上人生巅峰。", topN)); | ||
//[ { word: '当上', weight: 1 }, | ||
// { word: '不用', weight: 0.9898479330698993 }, | ||
// { word: '多久', weight: 0.9851260595435759 }, | ||
// { word: '加薪', weight: 0.9830464899847804 }, | ||
// { word: '升职', weight: 0.9802777682279076 } ] | ||
``` | ||
@@ -125,0 +132,0 @@ |
@@ -32,2 +32,5 @@ var nodejieba = require("../index.js"); | ||
result = nodejieba.textRankExtract(sentence, topN); | ||
console.log(result); | ||
result = nodejieba.cut("男默女泪"); | ||
@@ -34,0 +37,0 @@ console.log(result); |
@@ -301,2 +301,26 @@ var should = require("should"); | ||
it('nodejieba.textRankExtract(sentence, 5)', function() { | ||
nodejieba.textRankExtract(sentence, 5).should.eql([ | ||
{ | ||
"weight": 1, | ||
"word": "当上" | ||
}, | ||
{ | ||
"weight": 0.9898479330698993, | ||
"word": "不用" | ||
}, | ||
{ | ||
"weight": 0.9851260595435759, | ||
"word": "多久" | ||
}, | ||
{ | ||
"weight": 0.9830464899847804, | ||
"word": "加薪" | ||
}, | ||
{ | ||
"weight": 0.9802777682279076, | ||
"word": "升职" | ||
}]); | ||
}); | ||
it('nodejieba.cut("红掌拨清波")', function() { | ||
@@ -303,0 +327,0 @@ nodejieba.cut("红掌拨清波").should.eql([ |
@@ -27,4 +27,5 @@ declare module "nodejieba" { | ||
export function extract(sentence: string, threshold: number): ExtractResult[]; | ||
export function textRankExtract(sentence: string, threshold: number): ExtractResult[]; | ||
export function insertWord(sentence: string): boolean; | ||
export function cutSmall(sentence: string, small: number): boolean; | ||
} |
@@ -28,2 +28,5 @@ import nodejieba from "nodejieba"; | ||
result = nodejieba.textRankExtract(sentence, topN); | ||
console.log(result); | ||
result = nodejieba.cut("男默女泪"); | ||
@@ -36,2 +39,2 @@ console.log(result); | ||
result = nodejieba.cutSmall("南京市长江大桥", 3); | ||
console.log(result); | ||
console.log(result); |
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
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
11762713
557
219