Skip to content

Commit d9667b4

Browse files
committed
Stop word removal code with the output
Stop words have been removed using the npm library. Please use nodejs to run the code. Former-commit-id: 4848d4414da9f4ebe8f41ace830474eac5999907
1 parent 93af2a8 commit d9667b4

File tree

9 files changed

+261927
-0
lines changed

9 files changed

+261927
-0
lines changed

FeatureExtraction/StopWord removal/FrenchSW.txt

Lines changed: 140705 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const fs = require('fs');
2+
var unique = require('array-unique');
3+
var csvdata = require('csvdata');
4+
var writeFile = require('write');
5+
var createFile = require('create-file');
6+
var unique = require('array-unique');
7+
var HashMap = require('hashmap');
8+
sw = require('stopword')
9+
var LineByLineReader = require('line-by-line'),
10+
lr = new LineByLineReader('German_v1.txt');
11+
12+
lr.on('line', function (line) {
13+
// 'line' contains the current line without the trailing newline character.
14+
total = line.toLowerCase();
15+
var oldString = total.split(' ');
16+
var newString = sw.removeStopwords(oldString,sw.de) + '\n';
17+
fs.appendFile('GermanSW.txt', newString, (err) => {
18+
// throws an error, you could also catch it here
19+
if (err) throw err;
20+
21+
// success case, the file was saved
22+
// console.log('saved!');
23+
});
24+
25+
// console.log(charArr);
26+
});
27+
28+
lr.on('end', function () {
29+
30+
31+
});

0 commit comments

Comments
 (0)