cspell-dictionary 6.23.0 → 6.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,30 +19,30 @@ export interface SuggestOptions {
|
|
|
19
19
|
* Compounding Mode.
|
|
20
20
|
* `NONE` is the best option.
|
|
21
21
|
*/
|
|
22
|
-
compoundMethod?: CompoundWordsMethod;
|
|
22
|
+
compoundMethod?: CompoundWordsMethod | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* The limit on the number of suggestions to generate. If `allowTies` is true, it is possible
|
|
25
25
|
* for more suggestions to be generated.
|
|
26
26
|
*/
|
|
27
|
-
numSuggestions?: number;
|
|
27
|
+
numSuggestions?: number | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Max number of changes / edits to the word to get to a suggestion matching suggestion.
|
|
30
30
|
*/
|
|
31
|
-
numChanges?: number;
|
|
31
|
+
numChanges?: number | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* Allow for case-ingestive checking.
|
|
34
34
|
*/
|
|
35
|
-
ignoreCase?: boolean;
|
|
35
|
+
ignoreCase?: boolean | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* If multiple suggestions have the same edit / change "cost", then included them even if
|
|
38
38
|
* it causes more than `numSuggestions` to be returned.
|
|
39
39
|
* @default false
|
|
40
40
|
*/
|
|
41
|
-
includeTies?: boolean;
|
|
41
|
+
includeTies?: boolean | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Maximum amount of time to allow for generating suggestions.
|
|
44
44
|
*/
|
|
45
|
-
timeout?: number;
|
|
45
|
+
timeout?: number | undefined;
|
|
46
46
|
}
|
|
47
47
|
export type FindOptions = SearchOptions;
|
|
48
48
|
export interface FindResult {
|
|
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.__testing__ = exports.isSpellingDictionaryCollection = exports.createCollection = void 0;
|
|
27
27
|
const cspell_trie_lib_1 = require("cspell-trie-lib");
|
|
28
28
|
const gensequence_1 = require("gensequence");
|
|
29
|
-
const clean_1 = require("../util/clean");
|
|
30
29
|
const util_1 = require("../util/util");
|
|
31
30
|
const Defaults = __importStar(require("./defaults"));
|
|
32
31
|
const SpellingDictionary_1 = require("./SpellingDictionary");
|
|
@@ -79,14 +78,15 @@ class SpellingDictionaryCollectionImpl {
|
|
|
79
78
|
!this.isForbidden(word) &&
|
|
80
79
|
!this.isNoSuggestWord(word, suggestOptions));
|
|
81
80
|
};
|
|
82
|
-
const
|
|
81
|
+
const collectorOptions = {
|
|
83
82
|
numSuggestions,
|
|
84
83
|
filter,
|
|
85
84
|
changeLimit: numChanges,
|
|
86
85
|
includeTies,
|
|
87
86
|
ignoreCase,
|
|
88
87
|
timeout,
|
|
89
|
-
}
|
|
88
|
+
};
|
|
89
|
+
const collector = (0, SpellingDictionaryMethods_1.suggestionCollector)(word, collectorOptions);
|
|
90
90
|
this.genSuggestions(collector, suggestOptions);
|
|
91
91
|
return collector.suggestions.map((r) => ({ ...r, word: r.word }));
|
|
92
92
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__testMethods__ = exports.createWeightMapFromDictionaryInformation = exports.suggestArgsToSuggestOptions = exports.canonicalSearchOptions = exports.hasOptionToSearchOption = exports.wordSuggestForms = exports.wordSuggestFormsArray = exports.wordSearchForms = exports.defaultNumSuggestions = exports.suggestionCollector = exports.impersonateCollector = void 0;
|
|
4
4
|
const cspell_trie_lib_1 = require("cspell-trie-lib");
|
|
5
|
-
const clean_1 = require("../util/clean");
|
|
6
5
|
const text_1 = require("../util/text");
|
|
7
6
|
var cspell_trie_lib_2 = require("cspell-trie-lib");
|
|
8
7
|
Object.defineProperty(exports, "impersonateCollector", { enumerable: true, get: function () { return cspell_trie_lib_2.impersonateCollector; } });
|
|
@@ -90,14 +89,12 @@ function suggestArgsToSuggestOptions(args) {
|
|
|
90
89
|
const [_word, options, compoundMethod, numChanges, ignoreCase] = args;
|
|
91
90
|
const suggestOptions = typeof options === 'object'
|
|
92
91
|
? options
|
|
93
|
-
:
|
|
92
|
+
: {
|
|
94
93
|
numSuggestions: options,
|
|
95
94
|
compoundMethod,
|
|
96
95
|
numChanges,
|
|
97
96
|
ignoreCase,
|
|
98
|
-
|
|
99
|
-
timeout: undefined,
|
|
100
|
-
});
|
|
97
|
+
};
|
|
101
98
|
return suggestOptions;
|
|
102
99
|
}
|
|
103
100
|
exports.suggestArgsToSuggestOptions = suggestArgsToSuggestOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-dictionary",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.24.0",
|
|
4
4
|
"description": "A spelling dictionary library useful for checking words and getting suggestions.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"ts-jest": "^29.0.5"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@cspell/cspell-pipe": "6.
|
|
47
|
-
"@cspell/cspell-types": "6.
|
|
48
|
-
"cspell-trie-lib": "6.
|
|
46
|
+
"@cspell/cspell-pipe": "6.24.0",
|
|
47
|
+
"@cspell/cspell-types": "6.24.0",
|
|
48
|
+
"cspell-trie-lib": "6.24.0",
|
|
49
49
|
"fast-equals": "^4.0.3",
|
|
50
50
|
"gensequence": "^4.0.3"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "0d1e8bf9426cd0bfb814df4f61da12d8aee57ddd"
|
|
53
53
|
}
|