cspell-trie-lib
Advanced tools
Comparing version 4.1.6 to 4.1.7
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const TrieNode_1 = require("./TrieNode"); | ||
const gensequence_1 = require("gensequence"); | ||
const MinReferenceCount = 3; | ||
/** | ||
@@ -45,2 +47,8 @@ * An iterator that will emit TrieRefNodes mostly in descending frequency | ||
} | ||
function* walkByTallies(tallies) { | ||
const nodes = [...gensequence_1.genSequence(tallies).filter(a => a[1] >= MinReferenceCount)].sort((a, b) => b[1] - a[1]); | ||
for (const [n] of nodes) { | ||
yield* walkByRollup(n); | ||
} | ||
} | ||
function* walkByRollup(n) { | ||
@@ -67,6 +75,9 @@ var _a; | ||
} | ||
function* walk(n) { | ||
function* walk(root) { | ||
cached.set(eow, count++); | ||
yield convert(eow); | ||
yield* walkByRollup(n); | ||
// Emit the highest referenced nodes first. | ||
yield* walkByTallies(tallies); | ||
// Emit the rest. | ||
yield* walkByRollup(root); | ||
} | ||
@@ -73,0 +84,0 @@ tally(root); |
{ | ||
"name": "cspell-trie-lib", | ||
"version": "4.1.6", | ||
"version": "4.1.7", | ||
"description": "Trie Data Structure to support cspell.", | ||
@@ -59,3 +59,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "d3d97247b35d1c755ae6dc95cc72e4b8381b68f6" | ||
"gitHead": "73f2223b8b222203c2e996d865564ef85fb67075" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76574
2060