MCPcopy Create free account
hub / github.com/dscape/spell / quality

Function quality

test/spell.js:13–44  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

11}
12
13function quality(name) {
14 var dict = spell()
15 , n = 0
16 , bad = 0
17 , unknown = 0
18 , tests = (name === '2') ? PERF2 : PERF1
19 , target
20 , start
21 , exported
22 ;
23
24 dict.load({ corpus: big });
25 exported = dict['export']().corpus;
26
27 for (target in tests) {
28 if (tests.hasOwnProperty(target)) {
29 var wrongs = tests[target];
30 wrongs.split(/\s+/).forEach(function(wrong) {
31 n++;
32 var w = dict.lucky(wrong);
33 if (w !== target) {
34 bad++;
35 if (!exported.hasOwnProperty(target)) {
36 unknown++;
37 }
38 }
39 });
40 }
41 }
42
43 return { "bad": bad, "n": n, "unknown" : unknown };
44}
45
46describe('spell', function(){
47 var readme;

Callers 1

spell.jsFile · 0.85

Calls 1

spellFunction · 0.85

Tested by

no test coverage detected