forked from DennisNerush/reversim-crawler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean.js
23 lines (18 loc) · 764 Bytes
/
clean.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var fuzz = require('fuzzball');
//var contains_dupes = ['fuzzy wuzzy', 'fuzzy wuzz', 'not a dupe'];
var contains_dupes = ['Outbrain', 'WeWork', 'Wix', 'Kenshoo', 'Taboola', 'Wix.com' ]
console.log('\n');
console.log('*** ' + contains_dupes + ' ***');
console.log('\n');
var results_cutoff = fuzz.dedupe(contains_dupes, options)
console.log(results_cutoff);
console.log('\n');
// [item, index/key of item in original list]
//[ [ 'fuzzy wuzzy', 0 ],
// [ 'not a dupe', 2 ] ]
options.keepmap = true;
var results_keep = fuzz.dedupe(contains_dupes, options)
console.log(results_keep);
// [item, index/key of item in original list, [output of fuzz.extract for item]]
//[ [ 'fuzzy wuzzy', 0, [ [Object], [Object] ] ],
// [ 'not a dupe', 2, [ [Object] ] ] ]