@cspell/cspell-types 5.17.0 → 5.18.0-alpha.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.
- package/cspell.schema.json +118 -4
- package/dist/DictionaryInformation.d.ts +79 -10
- package/dist/index.d.ts +2 -1
- package/package.json +2 -2
package/cspell.schema.json
CHANGED
|
@@ -30,6 +30,32 @@
|
|
|
30
30
|
],
|
|
31
31
|
"type": "string"
|
|
32
32
|
},
|
|
33
|
+
"CharacterSet": {
|
|
34
|
+
"description": "This is a set of characters that can include `-` or `|`\n- `-` - indicates a range of characters: `a-c` => `abc`\n- `|` - is a group separator, indicating that the characters on either side are not related.",
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"CharacterSetCosts": {
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"properties": {
|
|
40
|
+
"characters": {
|
|
41
|
+
"$ref": "#/definitions/CharacterSet",
|
|
42
|
+
"description": "This is a set of characters that can include `-` or `|`\n- `-` - indicates a range of characters: `a-c` => `abc`\n- `|` - is a group separator, indicating that the characters on either side are not related."
|
|
43
|
+
},
|
|
44
|
+
"cost": {
|
|
45
|
+
"description": "the cost to insert / delete / replace / swap the characters in a group",
|
|
46
|
+
"type": "number"
|
|
47
|
+
},
|
|
48
|
+
"penalty": {
|
|
49
|
+
"description": "The penalty cost to apply if the accent is used. This is used to discourage",
|
|
50
|
+
"type": "number"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"required": [
|
|
54
|
+
"characters",
|
|
55
|
+
"cost"
|
|
56
|
+
],
|
|
57
|
+
"type": "object"
|
|
58
|
+
},
|
|
33
59
|
"CostMapDefInsDel": {
|
|
34
60
|
"additionalProperties": false,
|
|
35
61
|
"properties": {
|
|
@@ -365,10 +391,48 @@
|
|
|
365
391
|
"additionalProperties": false,
|
|
366
392
|
"description": "Use by dictionary authors to help improve the quality of suggestions given from the dictionary.\n\nAdded with `v5.16.0`.",
|
|
367
393
|
"properties": {
|
|
394
|
+
"accents": {
|
|
395
|
+
"anyOf": [
|
|
396
|
+
{
|
|
397
|
+
"$ref": "#/definitions/CharacterSet"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"items": {
|
|
401
|
+
"$ref": "#/definitions/CharacterSetCosts"
|
|
402
|
+
},
|
|
403
|
+
"type": "array"
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"default": "̀-́",
|
|
407
|
+
"description": "The accent characters"
|
|
408
|
+
},
|
|
409
|
+
"alphabet": {
|
|
410
|
+
"anyOf": [
|
|
411
|
+
{
|
|
412
|
+
"$ref": "#/definitions/CharacterSet"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"items": {
|
|
416
|
+
"$ref": "#/definitions/CharacterSetCosts"
|
|
417
|
+
},
|
|
418
|
+
"type": "array"
|
|
419
|
+
}
|
|
420
|
+
],
|
|
421
|
+
"default": "a-zA-Z",
|
|
422
|
+
"description": "The alphabet to use."
|
|
423
|
+
},
|
|
424
|
+
"costs": {
|
|
425
|
+
"$ref": "#/definitions/EditCosts",
|
|
426
|
+
"description": "Define edit costs."
|
|
427
|
+
},
|
|
368
428
|
"hunspellInformation": {
|
|
369
429
|
"$ref": "#/definitions/HunspellInformation",
|
|
370
430
|
"description": "Used by dictionary authors"
|
|
371
431
|
},
|
|
432
|
+
"locale": {
|
|
433
|
+
"description": "The locale of the dictionary. Example: `nl,nl-be`",
|
|
434
|
+
"type": "string"
|
|
435
|
+
},
|
|
372
436
|
"suggestionEditCosts": {
|
|
373
437
|
"$ref": "#/definitions/SuggestionCostsDefs",
|
|
374
438
|
"description": "Used in making suggestions. The lower the value, the more likely the suggestion will be near the top of the suggestion list."
|
|
@@ -401,6 +465,37 @@
|
|
|
401
465
|
],
|
|
402
466
|
"description": "Reference to a dictionary by name. One of:\n- {@link DictionaryRef } \n- {@link DictionaryNegRef }"
|
|
403
467
|
},
|
|
468
|
+
"EditCosts": {
|
|
469
|
+
"additionalProperties": false,
|
|
470
|
+
"properties": {
|
|
471
|
+
"accentCosts": {
|
|
472
|
+
"default": 1,
|
|
473
|
+
"description": "The cost to add / remove an accent This should be very cheap, it helps with fixing accent issues.",
|
|
474
|
+
"type": "number"
|
|
475
|
+
},
|
|
476
|
+
"baseCost": {
|
|
477
|
+
"default": 100,
|
|
478
|
+
"description": "This is the base cost for making an edit.",
|
|
479
|
+
"type": "number"
|
|
480
|
+
},
|
|
481
|
+
"capsCosts": {
|
|
482
|
+
"default": 1,
|
|
483
|
+
"description": "The cost to change capitalization. This should be very cheap, it helps with fixing capitalization issues.",
|
|
484
|
+
"type": "number"
|
|
485
|
+
},
|
|
486
|
+
"firstLetterPenalty": {
|
|
487
|
+
"default": 4,
|
|
488
|
+
"description": "The extra cost incurred for changing the first letter of a word. This value should be less than `100 - baseCost`.",
|
|
489
|
+
"type": "number"
|
|
490
|
+
},
|
|
491
|
+
"nonAlphabetCosts": {
|
|
492
|
+
"default": 110,
|
|
493
|
+
"description": "This is the cost for characters not in the alphabet.",
|
|
494
|
+
"type": "number"
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
"type": "object"
|
|
498
|
+
},
|
|
404
499
|
"FSPathResolvable": {
|
|
405
500
|
"$ref": "#/definitions/FsPath",
|
|
406
501
|
"description": "A File System Path.\n\nSpecial Properties:\n- `${cwd}` prefix - will be replaced with the current working directory.\n- Relative paths are relative to the configuration file."
|
|
@@ -438,9 +533,24 @@
|
|
|
438
533
|
"additionalProperties": false,
|
|
439
534
|
"description": "The costs to apply when using the hunspell settings",
|
|
440
535
|
"properties": {
|
|
536
|
+
"accentCosts": {
|
|
537
|
+
"default": 1,
|
|
538
|
+
"description": "The cost to add / remove an accent This should be very cheap, it helps with fixing accent issues.",
|
|
539
|
+
"type": "number"
|
|
540
|
+
},
|
|
541
|
+
"baseCost": {
|
|
542
|
+
"default": 100,
|
|
543
|
+
"description": "This is the base cost for making an edit.",
|
|
544
|
+
"type": "number"
|
|
545
|
+
},
|
|
546
|
+
"capsCosts": {
|
|
547
|
+
"default": 1,
|
|
548
|
+
"description": "The cost to change capitalization. This should be very cheap, it helps with fixing capitalization issues.",
|
|
549
|
+
"type": "number"
|
|
550
|
+
},
|
|
441
551
|
"firstLetterPenalty": {
|
|
442
552
|
"default": 4,
|
|
443
|
-
"description": "The extra cost incurred for changing the first letter of a word. This value should be less than `100 -
|
|
553
|
+
"description": "The extra cost incurred for changing the first letter of a word. This value should be less than `100 - baseCost`.",
|
|
444
554
|
"type": "number"
|
|
445
555
|
},
|
|
446
556
|
"ioConvertCost": {
|
|
@@ -449,7 +559,7 @@
|
|
|
449
559
|
"type": "number"
|
|
450
560
|
},
|
|
451
561
|
"keyboardCost": {
|
|
452
|
-
"default":
|
|
562
|
+
"default": 99,
|
|
453
563
|
"description": "The cost of replacing or swapping any adjacent keyboard characters.\n\nThis should be slightly cheaper than `tryCharCost`.",
|
|
454
564
|
"type": "number"
|
|
455
565
|
},
|
|
@@ -458,14 +568,18 @@
|
|
|
458
568
|
"description": "mapSet replacement cost is the cost to substitute one character with another from the same set.\n\nMap characters are considered very similar to each other and are often the cause of simple mistakes.",
|
|
459
569
|
"type": "number"
|
|
460
570
|
},
|
|
571
|
+
"nonAlphabetCosts": {
|
|
572
|
+
"default": 110,
|
|
573
|
+
"description": "This is the cost for characters not in the alphabet.",
|
|
574
|
+
"type": "number"
|
|
575
|
+
},
|
|
461
576
|
"replaceCosts": {
|
|
462
577
|
"default": 75,
|
|
463
578
|
"description": "The cost to substitute pairs found in the replace settings.",
|
|
464
579
|
"type": "number"
|
|
465
580
|
},
|
|
466
581
|
"tryCharCost": {
|
|
467
|
-
"
|
|
468
|
-
"description": "The cost of inserting / deleting / or swapping any `tryChars`",
|
|
582
|
+
"description": "The cost of inserting / deleting / or swapping any `tryChars` Defaults to `baseCosts`",
|
|
469
583
|
"type": "number"
|
|
470
584
|
}
|
|
471
585
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SuggestionCostsDefs } from '
|
|
1
|
+
import { SuggestionCostsDefs } from './suggestionCostsDef';
|
|
2
2
|
/**
|
|
3
3
|
* Use by dictionary authors to help improve the quality of suggestions
|
|
4
4
|
* given from the dictionary.
|
|
@@ -6,6 +6,25 @@ import { SuggestionCostsDefs } from '.';
|
|
|
6
6
|
* Added with `v5.16.0`.
|
|
7
7
|
*/
|
|
8
8
|
export interface DictionaryInformation {
|
|
9
|
+
/**
|
|
10
|
+
* The locale of the dictionary.
|
|
11
|
+
* Example: `nl,nl-be`
|
|
12
|
+
*/
|
|
13
|
+
locale?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The alphabet to use.
|
|
16
|
+
* @default "a-zA-Z"
|
|
17
|
+
*/
|
|
18
|
+
alphabet?: CharacterSet | CharacterSetCosts[];
|
|
19
|
+
/**
|
|
20
|
+
* The accent characters
|
|
21
|
+
* @default "\u0300-\u0341"
|
|
22
|
+
*/
|
|
23
|
+
accents?: CharacterSet | CharacterSetCosts[];
|
|
24
|
+
/**
|
|
25
|
+
* Define edit costs.
|
|
26
|
+
*/
|
|
27
|
+
costs?: EditCosts;
|
|
9
28
|
/**
|
|
10
29
|
* Used in making suggestions. The lower the value, the more likely the suggestion
|
|
11
30
|
* will be near the top of the suggestion list.
|
|
@@ -169,23 +188,17 @@ export interface HunspellInformation {
|
|
|
169
188
|
* ```
|
|
170
189
|
*/
|
|
171
190
|
declare type HunspellAffContent = string;
|
|
172
|
-
interface HunspellCosts {
|
|
191
|
+
interface HunspellCosts extends EditCosts {
|
|
173
192
|
/**
|
|
174
193
|
* The cost of inserting / deleting / or swapping any `tryChars`
|
|
175
|
-
*
|
|
194
|
+
* Defaults to `baseCosts`
|
|
176
195
|
*/
|
|
177
196
|
tryCharCost?: number;
|
|
178
|
-
/**
|
|
179
|
-
* The extra cost incurred for changing the first letter of a word.
|
|
180
|
-
* This value should be less than `100 - tryCharCost`.
|
|
181
|
-
* @default 4
|
|
182
|
-
*/
|
|
183
|
-
firstLetterPenalty?: number;
|
|
184
197
|
/**
|
|
185
198
|
* The cost of replacing or swapping any adjacent keyboard characters.
|
|
186
199
|
*
|
|
187
200
|
* This should be slightly cheaper than `tryCharCost`.
|
|
188
|
-
* @default
|
|
201
|
+
* @default 99
|
|
189
202
|
*/
|
|
190
203
|
keyboardCost?: number;
|
|
191
204
|
/**
|
|
@@ -213,5 +226,61 @@ interface HunspellCosts {
|
|
|
213
226
|
*/
|
|
214
227
|
replaceCosts?: number;
|
|
215
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
*
|
|
231
|
+
*/
|
|
232
|
+
export interface EditCosts {
|
|
233
|
+
/**
|
|
234
|
+
* This is the base cost for making an edit.
|
|
235
|
+
* @default 100
|
|
236
|
+
*/
|
|
237
|
+
baseCost?: number;
|
|
238
|
+
/**
|
|
239
|
+
* This is the cost for characters not in the alphabet.
|
|
240
|
+
* @default 110
|
|
241
|
+
*/
|
|
242
|
+
nonAlphabetCosts?: number;
|
|
243
|
+
/**
|
|
244
|
+
* The extra cost incurred for changing the first letter of a word.
|
|
245
|
+
* This value should be less than `100 - baseCost`.
|
|
246
|
+
* @default 4
|
|
247
|
+
*/
|
|
248
|
+
firstLetterPenalty?: number;
|
|
249
|
+
/**
|
|
250
|
+
* The cost to change capitalization.
|
|
251
|
+
* This should be very cheap, it helps with fixing capitalization issues.
|
|
252
|
+
* @default 1
|
|
253
|
+
*/
|
|
254
|
+
capsCosts?: number;
|
|
255
|
+
/**
|
|
256
|
+
* The cost to add / remove an accent
|
|
257
|
+
* This should be very cheap, it helps with fixing accent issues.
|
|
258
|
+
* @default 1
|
|
259
|
+
*/
|
|
260
|
+
accentCosts?: number;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* This is a set of characters that can include `-` or `|`
|
|
264
|
+
* - `-` - indicates a range of characters: `a-c` => `abc`
|
|
265
|
+
* - `|` - is a group separator, indicating that the characters on either side
|
|
266
|
+
* are not related.
|
|
267
|
+
*/
|
|
268
|
+
export declare type CharacterSet = string;
|
|
269
|
+
export interface CharacterSetCosts {
|
|
270
|
+
/**
|
|
271
|
+
* This is a set of characters that can include `-` or `|`
|
|
272
|
+
* - `-` - indicates a range of characters: `a-c` => `abc`
|
|
273
|
+
* - `|` - is a group separator, indicating that the characters on either side
|
|
274
|
+
* are not related.
|
|
275
|
+
*/
|
|
276
|
+
characters: CharacterSet;
|
|
277
|
+
/** the cost to insert / delete / replace / swap the characters in a group */
|
|
278
|
+
cost: number;
|
|
279
|
+
/**
|
|
280
|
+
* The penalty cost to apply if the accent is used.
|
|
281
|
+
* This is used to discourage
|
|
282
|
+
*/
|
|
283
|
+
penalty?: number;
|
|
284
|
+
}
|
|
216
285
|
export {};
|
|
217
286
|
//# sourceMappingURL=DictionaryInformation.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export { ConfigFields } from './configFields';
|
|
|
2
2
|
export type { CSpellUserSettingsFields } from './configFields';
|
|
3
3
|
export * from './CSpellReporter';
|
|
4
4
|
export * from './CSpellSettingsDef';
|
|
5
|
+
export type { CharacterSet, CharacterSetCosts, DictionaryInformation, EditCosts } from './DictionaryInformation';
|
|
6
|
+
export type { Feature, Features } from './features';
|
|
5
7
|
export type { SuggestionCostMapDef, SuggestionCostsDefs } from './suggestionCostsDef';
|
|
6
8
|
export type { TextDocumentOffset, TextOffset } from './TextOffset';
|
|
7
|
-
export type { Features, Feature } from './features';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "5.
|
|
6
|
+
"version": "5.18.0-alpha.0",
|
|
7
7
|
"description": "Types for cspell and cspell-lib",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"typings": "dist/index.d.ts",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"typedoc-plugin-markdown": "^3.11.12",
|
|
58
58
|
"typescript": "^4.5.5"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "d3c6f34444f19e9d8e375d1cbea6f99d0f270716"
|
|
61
61
|
}
|