Skip to content

Commit 31f8dec

Browse files
author
Van-Duyet Le
committed
Update package and testcase
1 parent 4582e72 commit 31f8dec

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Stopwords filter for Nodejs, Javascript",
55
"main": "index.js",
66
"scripts": {
7-
"test": "node test/test.js"
7+
"test": "./node_modules/mocha/bin/mocha"
88
},
99
"repository": {
1010
"type": "git",
@@ -23,5 +23,13 @@
2323
"bugs": {
2424
"url": "https://github.com/duyetdev/node-stopwords-filter/issues"
2525
},
26-
"homepage": "https://github.com/duyetdev/node-stopwords-filter#readme"
26+
"homepage": "https://github.com/duyetdev/node-stopwords-filter#readme",
27+
"dependencies": {
28+
"node-vntokenizer": "0.0.2",
29+
"stopwords": "0.0.5",
30+
"vietnamese-stopwords": "0.0.2"
31+
},
32+
"devDependencies": {
33+
"mocha": "^2.3.3"
34+
}
2735
}

test/test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var stopwordsFilter = require('../');
2+
var f = new stopwordsFilter();
3+
4+
console.log();
5+
6+
var assert = require('assert');
7+
8+
describe('Stopword Filter', function() {
9+
it ('should by no error', function() {
10+
var f = new stopwordsFilter();
11+
assert.ok(f);
12+
});
13+
14+
it ('should be filter out stopword in english', function() {
15+
var input1 = "a whole new category is good for me";
16+
var result = f.filter(input1);
17+
assert.deepEqual([ 'category', 'good' ], result);
18+
console.log();
19+
console.log(input1, " ==> " ,result);
20+
});
21+
22+
it ('should be filter out stopword in vietnamse', function() {
23+
f.setLanguage('vi');
24+
25+
var input2 = "Chủ tịch mảng thiết bị của BlackBerry, ông Ron Louks cho biết Android 6.0 sẽ cập bến thiết bị này vào khoảng năm mới, tức là vào đầu tháng một";
26+
var result = f.filter(input2);
27+
28+
console.log(input2, " ==> " ,result);
29+
});
30+
});

0 commit comments

Comments
 (0)