1
1
'use strict' ;
2
2
const levenshteinEditDistance = require ( 'levenshtein-edit-distance' ) ;
3
3
const fastLevenshtein = require ( 'fast-levenshtein' ) . get ;
4
- const levenshteinComponent = require ( 'levenshtein-component' ) ;
5
- const ld = require ( 'ld' ) . computeDistance ;
6
- const levdist = require ( 'levdist' ) ;
7
- const natural = require ( 'natural' ) . LevenshteinDistance ;
8
- const levenshtein1 = require ( 'levenshtein' ) ;
9
4
const talisman = require ( 'talisman/metrics/distance/levenshtein' ) ;
10
5
const leven = require ( 'leven' ) ;
11
6
const levenshtein = require ( './' ) ;
@@ -55,7 +50,6 @@ suite('50 paragraphs, length max=500 min=240 avr=372.5', function()
55
50
{
56
51
paragraphBench ( talisman ) ;
57
52
} ) ;
58
-
59
53
bench ( 'leven' , function ( )
60
54
{
61
55
paragraphBench ( leven ) ;
@@ -69,31 +63,6 @@ suite('50 paragraphs, length max=500 min=240 avr=372.5', function()
69
63
{
70
64
paragraphBench ( fastLevenshtein ) ;
71
65
} ) ;
72
-
73
- bench ( 'levenshtein-component' , function ( )
74
- {
75
- paragraphBench ( levenshteinComponent ) ;
76
- } ) ;
77
-
78
- bench ( 'levdist' , function ( )
79
- {
80
- paragraphBench ( levdist ) ;
81
- } ) ;
82
-
83
- bench ( 'ld' , function ( )
84
- {
85
- paragraphBench ( ld ) ;
86
- } ) ;
87
-
88
- bench ( 'natural' , function ( )
89
- {
90
- paragraphBench ( natural ) ;
91
- } ) ;
92
-
93
- bench ( 'levenshtein' , function ( )
94
- {
95
- paragraphBench ( levenshtein1 ) ;
96
- } ) ;
97
66
} )
98
67
99
68
suite ( '100 sentences, length max=170 min=6 avr=57.5' , function ( )
@@ -114,7 +83,6 @@ suite('100 sentences, length max=170 min=6 avr=57.5', function()
114
83
{
115
84
sentenceBench ( talisman ) ;
116
85
} ) ;
117
-
118
86
bench ( 'leven' , function ( )
119
87
{
120
88
sentenceBench ( leven ) ;
@@ -128,31 +96,6 @@ suite('100 sentences, length max=170 min=6 avr=57.5', function()
128
96
{
129
97
sentenceBench ( fastLevenshtein ) ;
130
98
} ) ;
131
-
132
- bench ( 'levenshtein-component' , function ( )
133
- {
134
- sentenceBench ( levenshteinComponent ) ;
135
- } ) ;
136
-
137
- bench ( 'levdist' , function ( )
138
- {
139
- sentenceBench ( levdist ) ;
140
- } ) ;
141
-
142
- bench ( 'ld' , function ( )
143
- {
144
- sentenceBench ( ld ) ;
145
- } ) ;
146
-
147
- bench ( 'natural' , function ( )
148
- {
149
- sentenceBench ( natural ) ;
150
- } ) ;
151
-
152
- bench ( 'levenshtein' , function ( )
153
- {
154
- sentenceBench ( levenshtein1 ) ;
155
- } ) ;
156
99
} ) ;
157
100
158
101
suite ( '2000 words, length max=20 min=3 avr=9.5' , function ( )
@@ -174,7 +117,6 @@ suite('2000 words, length max=20 min=3 avr=9.5', function()
174
117
{
175
118
wordBench ( talisman ) ;
176
119
} ) ;
177
-
178
120
bench ( 'leven' , function ( )
179
121
{
180
122
wordBench ( leven ) ;
@@ -189,31 +131,33 @@ suite('2000 words, length max=20 min=3 avr=9.5', function()
189
131
{
190
132
wordBench ( fastLevenshtein ) ;
191
133
} ) ;
134
+ /*
192
135
193
- bench ( 'levenshtein-component' , function ( )
194
- {
195
- wordBench ( levenshteinComponent ) ;
196
- } ) ;
136
+ bench('levenshtein-component', function()
137
+ {
138
+ wordBench(levenshteinComponent);
139
+ });
197
140
198
- bench ( 'levdist' , function ( )
199
- {
200
- wordBench ( levdist ) ;
201
- } ) ;
141
+ bench('levdist', function()
142
+ {
143
+ wordBench(levdist);
144
+ });
202
145
203
- bench ( 'ld' , function ( )
204
- {
205
- wordBench ( ld ) ;
206
- } ) ;
146
+ bench('ld', function()
147
+ {
148
+ wordBench(ld);
149
+ });
207
150
208
- bench ( 'natural' , function ( )
209
- {
210
- wordBench ( natural ) ;
211
- } ) ;
151
+ bench('natural', function()
152
+ {
153
+ wordBench(natural);
154
+ });
212
155
213
- bench ( 'levenshtein' , function ( )
214
- {
215
- wordBench ( levenshtein1 ) ;
216
- } ) ;
156
+ bench('levenshtein', function()
157
+ {
158
+ wordBench(levenshtein1);
159
+ });
160
+ */
217
161
} ) ;
218
162
219
163
var paragraphs = [
0 commit comments