hunspell-reader 6.1.2 → 6.1.3
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/dist/aff.js +2 -3
- package/dist/affReader.js +2 -3
- package/package.json +6 -6
package/dist/aff.js
CHANGED
|
@@ -51,7 +51,7 @@ class Aff {
|
|
|
51
51
|
* @param {string} line - the line from the .dic file.
|
|
52
52
|
*/
|
|
53
53
|
applyRulesToDicEntry(line, maxDepth) {
|
|
54
|
-
const maxSuffixDepth = maxDepth
|
|
54
|
+
const maxSuffixDepth = maxDepth ?? this.maxSuffixDepth;
|
|
55
55
|
const [lineLeft] = line.split(/\s+/, 1);
|
|
56
56
|
const [word, rules = ''] = lineLeft.split('/', 2);
|
|
57
57
|
const results = this.applyRulesToWord(asAffWord(word, rules), maxSuffixDepth).map((affWord) => ({
|
|
@@ -66,8 +66,7 @@ class Aff {
|
|
|
66
66
|
* @internal
|
|
67
67
|
*/
|
|
68
68
|
applyRulesToWord(affWord, remainingDepth) {
|
|
69
|
-
|
|
70
|
-
const compoundMin = (_a = this.affInfo.COMPOUNDMIN) !== null && _a !== void 0 ? _a : 3;
|
|
69
|
+
const compoundMin = this.affInfo.COMPOUNDMIN ?? 3;
|
|
71
70
|
const { word, base, suffix, prefix, dic } = affWord;
|
|
72
71
|
const allRules = this.getMatchingRules(affWord.rules);
|
|
73
72
|
const { rulesApplied, flags } = allRules
|
package/dist/affReader.js
CHANGED
|
@@ -51,7 +51,7 @@ function afEntry() {
|
|
|
51
51
|
function simpleTable(map) {
|
|
52
52
|
let data;
|
|
53
53
|
function getValue() {
|
|
54
|
-
if (data
|
|
54
|
+
if (data?.values)
|
|
55
55
|
return map(data.values);
|
|
56
56
|
return undefined;
|
|
57
57
|
}
|
|
@@ -320,9 +320,8 @@ function parseAff(affFileContent, encoding = UTF8) {
|
|
|
320
320
|
.filter((line) => line.trim() !== '')
|
|
321
321
|
.map(parseLine)
|
|
322
322
|
.forEach((line) => {
|
|
323
|
-
var _a;
|
|
324
323
|
const field = line.option;
|
|
325
|
-
|
|
324
|
+
affFieldCollectionTable[field]?.addLine(line);
|
|
326
325
|
});
|
|
327
326
|
return collectionToAffInfo(affFieldCollectionTable, encoding);
|
|
328
327
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hunspell-reader",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"description": "A library for reading Hunspell Dictionary Files",
|
|
5
5
|
"bin": "bin.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"homepage": "https://github.com/Jason-Rev/hunspell-reader#readme",
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/fs-extra": "^9.0.13",
|
|
42
|
-
"@types/jest": "^28.1.
|
|
43
|
-
"@types/node": "^
|
|
42
|
+
"@types/jest": "^28.1.3",
|
|
43
|
+
"@types/node": "^18.0.0",
|
|
44
44
|
"jest": "^28.1.1",
|
|
45
45
|
"rimraf": "^3.0.2",
|
|
46
|
-
"ts-jest": "^28.0.
|
|
47
|
-
"typescript": "^4.7.
|
|
46
|
+
"ts-jest": "^28.0.5",
|
|
47
|
+
"typescript": "^4.7.4"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"commander": "^9.3.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=14"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "e96b313542f2ec0a38ac04d1422d97e724ded3a6"
|
|
59
59
|
}
|