@cspell/cspell-types 5.15.3 → 5.16.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 +16 -4
- package/dist/suggestionCostsDef.d.ts +28 -11
- package/package.json +2 -2
package/cspell.schema.json
CHANGED
|
@@ -42,9 +42,13 @@
|
|
|
42
42
|
"type": "number"
|
|
43
43
|
},
|
|
44
44
|
"map": {
|
|
45
|
-
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.",
|
|
45
|
+
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.\n\n- To match the beginning of a word, use `^`: `\"(^I)\"\"`.\n- To match the end of a word, use `$`: `\"(e$)(ing$)\"`.",
|
|
46
46
|
"type": "string"
|
|
47
47
|
},
|
|
48
|
+
"penalty": {
|
|
49
|
+
"description": "Add a penalty to the final cost. This is used to discourage certain suggestions.\n\nExample: ```yaml # Match adding/removing `-` to the end of a word. map: \"$(-$)\" replace: 50 penalty: 100 ```\n\nThis makes adding a `-` to the end of a word more expensive.\n\nThink of it as taking the toll way for speed but getting the bill later.",
|
|
50
|
+
"type": "number"
|
|
51
|
+
},
|
|
48
52
|
"replace": {
|
|
49
53
|
"description": "The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.",
|
|
50
54
|
"type": "number"
|
|
@@ -72,9 +76,13 @@
|
|
|
72
76
|
"type": "number"
|
|
73
77
|
},
|
|
74
78
|
"map": {
|
|
75
|
-
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.",
|
|
79
|
+
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.\n\n- To match the beginning of a word, use `^`: `\"(^I)\"\"`.\n- To match the end of a word, use `$`: `\"(e$)(ing$)\"`.",
|
|
76
80
|
"type": "string"
|
|
77
81
|
},
|
|
82
|
+
"penalty": {
|
|
83
|
+
"description": "Add a penalty to the final cost. This is used to discourage certain suggestions.\n\nExample: ```yaml # Match adding/removing `-` to the end of a word. map: \"$(-$)\" replace: 50 penalty: 100 ```\n\nThis makes adding a `-` to the end of a word more expensive.\n\nThink of it as taking the toll way for speed but getting the bill later.",
|
|
84
|
+
"type": "number"
|
|
85
|
+
},
|
|
78
86
|
"replace": {
|
|
79
87
|
"description": "The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.",
|
|
80
88
|
"type": "number"
|
|
@@ -102,9 +110,13 @@
|
|
|
102
110
|
"type": "number"
|
|
103
111
|
},
|
|
104
112
|
"map": {
|
|
105
|
-
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.",
|
|
113
|
+
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.\n\n- To match the beginning of a word, use `^`: `\"(^I)\"\"`.\n- To match the end of a word, use `$`: `\"(e$)(ing$)\"`.",
|
|
106
114
|
"type": "string"
|
|
107
115
|
},
|
|
116
|
+
"penalty": {
|
|
117
|
+
"description": "Add a penalty to the final cost. This is used to discourage certain suggestions.\n\nExample: ```yaml # Match adding/removing `-` to the end of a word. map: \"$(-$)\" replace: 50 penalty: 100 ```\n\nThis makes adding a `-` to the end of a word more expensive.\n\nThink of it as taking the toll way for speed but getting the bill later.",
|
|
118
|
+
"type": "number"
|
|
119
|
+
},
|
|
108
120
|
"replace": {
|
|
109
121
|
"description": "The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.",
|
|
110
122
|
"type": "number"
|
|
@@ -870,7 +882,7 @@
|
|
|
870
882
|
"$ref": "#/definitions/CostMapDefSwap"
|
|
871
883
|
}
|
|
872
884
|
],
|
|
873
|
-
"description": "A WeightedMapDef enables setting weights for edits between related characters and substrings.\n\nMultiple groups can be defined using a `|`. A multi-character substring is defined using `()`.\n\nFor example, in some languages, some letters sound alike.\n\n```
|
|
885
|
+
"description": "A WeightedMapDef enables setting weights for edits between related characters and substrings.\n\nMultiple groups can be defined using a `|`. A multi-character substring is defined using `()`.\n\nFor example, in some languages, some letters sound alike.\n\n```yaml map: 'sc(sh)(sch)(ss)|t(tt)' # two groups. replace: 50 # Make it 1/2 the cost of a normal edit to replace a `t` with `tt`. ```\n\nThe following could be used to make inserting, removing, or replacing vowels cheaper. ```yaml map: 'aeiouy' insDel: 50 # Make it is cheaper to insert or delete a vowel. replace: 45 # It is even cheaper to replace one with another. ```\n\nNote: the default edit distance is 100."
|
|
874
886
|
},
|
|
875
887
|
"SuggestionCostsDefs": {
|
|
876
888
|
"items": {
|
|
@@ -6,20 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
* For example, in some languages, some letters sound alike.
|
|
8
8
|
*
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* replace: 50, // Make it 1/2 the cost of a normal edit to replace a `t` with `tt`.
|
|
13
|
-
* }
|
|
9
|
+
* ```yaml
|
|
10
|
+
* map: 'sc(sh)(sch)(ss)|t(tt)' # two groups.
|
|
11
|
+
* replace: 50 # Make it 1/2 the cost of a normal edit to replace a `t` with `tt`.
|
|
14
12
|
* ```
|
|
15
13
|
*
|
|
16
14
|
* The following could be used to make inserting, removing, or replacing vowels cheaper.
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* replace: 45, // It is even cheaper to replace one with another.
|
|
22
|
-
* }
|
|
15
|
+
* ```yaml
|
|
16
|
+
* map: 'aeiouy'
|
|
17
|
+
* insDel: 50 # Make it is cheaper to insert or delete a vowel.
|
|
18
|
+
* replace: 45 # It is even cheaper to replace one with another.
|
|
23
19
|
* ```
|
|
24
20
|
*
|
|
25
21
|
* Note: the default edit distance is 100.
|
|
@@ -37,6 +33,10 @@ interface CostMapDefBase {
|
|
|
37
33
|
* To add a multi-character substring use `()`.
|
|
38
34
|
*
|
|
39
35
|
* Example: `"f(ph)(gh)"` results in the following set: `f`, `ph`, `gh`.
|
|
36
|
+
*
|
|
37
|
+
* - To match the beginning of a word, use `^`: `"(^I)""`.
|
|
38
|
+
* - To match the end of a word, use `$`: `"(e$)(ing$)"`.
|
|
39
|
+
*
|
|
40
40
|
*/
|
|
41
41
|
map: string;
|
|
42
42
|
/** The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. */
|
|
@@ -57,6 +57,23 @@ interface CostMapDefBase {
|
|
|
57
57
|
* A description to describe the purpose of the map.
|
|
58
58
|
*/
|
|
59
59
|
description?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Add a penalty to the final cost.
|
|
62
|
+
* This is used to discourage certain suggestions.
|
|
63
|
+
*
|
|
64
|
+
* Example:
|
|
65
|
+
* ```yaml
|
|
66
|
+
* # Match adding/removing `-` to the end of a word.
|
|
67
|
+
* map: "$(-$)"
|
|
68
|
+
* replace: 50
|
|
69
|
+
* penalty: 100
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* This makes adding a `-` to the end of a word more expensive.
|
|
73
|
+
*
|
|
74
|
+
* Think of it as taking the toll way for speed but getting the bill later.
|
|
75
|
+
*/
|
|
76
|
+
penalty?: number;
|
|
60
77
|
}
|
|
61
78
|
export interface CostMapDefReplace extends CostMapDefBase {
|
|
62
79
|
replace: number;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "5.
|
|
6
|
+
"version": "5.16.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.4"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "c5d994f58bdb48c4d16f1708607b28c8a7b52a65"
|
|
61
61
|
}
|