@scrabble-solver/word-lists 2.13.5-alpha.1 → 2.13.5-alpha.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/package.json +3 -3
- package/build/getDeDeWordList.d.ts +0 -2
- package/build/getDeDeWordList.js +0 -9
- package/build/getEnGbWordList.d.ts +0 -2
- package/build/getEnGbWordList.js +0 -9
- package/build/getEnUsWordList.d.ts +0 -2
- package/build/getEnUsWordList.js +0 -9
- package/build/getEsEsWordList.d.ts +0 -2
- package/build/getEsEsWordList.js +0 -18
- package/build/getFaIrWordList.d.ts +0 -2
- package/build/getFaIrWordList.js +0 -9
- package/build/getFrFrWordList.d.ts +0 -2
- package/build/getFrFrWordList.js +0 -10
- package/build/getPlPlWordList.d.ts +0 -2
- package/build/getPlPlWordList.js +0 -41
- package/build/getRoRoWordList.d.ts +0 -2
- package/build/getRoRoWordList.js +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/word-lists",
|
|
3
|
-
"version": "2.13.5-alpha.
|
|
3
|
+
"version": "2.13.5-alpha.3",
|
|
4
4
|
"description": "Scrabble Solver 2 - Word lists",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"clean": "rimraf build/"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@scrabble-solver/types": "^2.13.5-alpha.
|
|
26
|
+
"@scrabble-solver/types": "^2.13.5-alpha.3",
|
|
27
27
|
"cheerio": "^1.0.0-rc.12",
|
|
28
28
|
"follow-redirects": "^1.15.5",
|
|
29
29
|
"latinize": "^1.0.0",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"@types/latinize": "^0.2.18",
|
|
35
35
|
"@types/unzipper": "^0.10.9"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "df3cb16543b0664e0acae735b9010f2ff0607784"
|
|
38
38
|
}
|
package/build/getDeDeWordList.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const types_1 = require("@scrabble-solver/types");
|
|
4
|
-
const lib_1 = require("./lib");
|
|
5
|
-
const FILE_URL = 'https://raw.githubusercontent.com/hippler/german-wordlist/master/words.txt';
|
|
6
|
-
const getDeDeWordList = async () => {
|
|
7
|
-
return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.DE_DE);
|
|
8
|
-
};
|
|
9
|
-
exports.default = getDeDeWordList;
|
package/build/getEnGbWordList.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const types_1 = require("@scrabble-solver/types");
|
|
4
|
-
const lib_1 = require("./lib");
|
|
5
|
-
const FILE_URL = 'https://www.wordgamedictionary.com/sowpods/download/sowpods.txt';
|
|
6
|
-
const getEnGbWordList = async () => {
|
|
7
|
-
return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.EN_GB);
|
|
8
|
-
};
|
|
9
|
-
exports.default = getEnGbWordList;
|
package/build/getEnUsWordList.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const types_1 = require("@scrabble-solver/types");
|
|
4
|
-
const lib_1 = require("./lib");
|
|
5
|
-
const FILE_URL = 'https://www.wordgamedictionary.com/twl06/download/twl06.txt';
|
|
6
|
-
const getEnUsWordList = async () => {
|
|
7
|
-
return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.EN_US);
|
|
8
|
-
};
|
|
9
|
-
exports.default = getEnUsWordList;
|
package/build/getEsEsWordList.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const types_1 = require("@scrabble-solver/types");
|
|
7
|
-
const latinize_1 = __importDefault(require("latinize"));
|
|
8
|
-
const lib_1 = require("./lib");
|
|
9
|
-
const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/scrabble-dictionaries/master/spanish/fise-2.txt';
|
|
10
|
-
const N_PLACEHOLDER = '---n---';
|
|
11
|
-
const getEsEsWordList = async () => {
|
|
12
|
-
const words = await (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.ES_ES);
|
|
13
|
-
return words
|
|
14
|
-
.map((word) => word.replaceAll('ñ', N_PLACEHOLDER))
|
|
15
|
-
.map(latinize_1.default)
|
|
16
|
-
.map((word) => word.replaceAll(N_PLACEHOLDER, 'ñ'));
|
|
17
|
-
};
|
|
18
|
-
exports.default = getEsEsWordList;
|
package/build/getFaIrWordList.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const types_1 = require("@scrabble-solver/types");
|
|
4
|
-
const lib_1 = require("./lib");
|
|
5
|
-
const FILE_URL = 'https://raw.githubusercontent.com/MansourM/persian-to-persian-dictionary/main/moein/words.txt';
|
|
6
|
-
const getFaIrWordList = async () => {
|
|
7
|
-
return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.FA_IR);
|
|
8
|
-
};
|
|
9
|
-
exports.default = getFaIrWordList;
|
package/build/getFrFrWordList.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const types_1 = require("@scrabble-solver/types");
|
|
4
|
-
const lib_1 = require("./lib");
|
|
5
|
-
const FILE_URL = 'https://raw.githubusercontent.com/Thecoolsim/French-Scrabble-ODS8/main/French%20ODS%20dictionary.txt';
|
|
6
|
-
const getFrFrWordList = async () => {
|
|
7
|
-
const words = await (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.FR_FR);
|
|
8
|
-
return (0, lib_1.latinizeDiacritics)(words);
|
|
9
|
-
};
|
|
10
|
-
exports.default = getFrFrWordList;
|
package/build/getPlPlWordList.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const cheerio_1 = require("cheerio");
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const url_1 = require("url");
|
|
9
|
-
const lib_1 = require("./lib");
|
|
10
|
-
const PAGE_URL = 'https://sjp.pl/sl/growy/';
|
|
11
|
-
const FILE_TO_EXTRACT_FROM_ZIP = 'slowa.txt';
|
|
12
|
-
const getPlPlWordList = async () => {
|
|
13
|
-
const tempFilepath = (0, lib_1.getTempFilepath)();
|
|
14
|
-
const zipUrl = await fetchZipUrl(PAGE_URL);
|
|
15
|
-
const zipTempFilename = await (0, lib_1.downloadFile)(zipUrl);
|
|
16
|
-
await (0, lib_1.unzip)(zipTempFilename, FILE_TO_EXTRACT_FROM_ZIP, tempFilepath);
|
|
17
|
-
fs_1.default.unlinkSync(zipTempFilename);
|
|
18
|
-
const file = fs_1.default.readFileSync(tempFilepath, 'utf-8');
|
|
19
|
-
fs_1.default.unlinkSync(tempFilepath);
|
|
20
|
-
const words = (0, lib_1.extractWords)(file.toLocaleString(), 'pl-PL');
|
|
21
|
-
return words;
|
|
22
|
-
};
|
|
23
|
-
const fetchZipUrl = async (url) => {
|
|
24
|
-
const html = await (0, lib_1.downloadHtml)(url);
|
|
25
|
-
const filename = await parseZipContainingPage(html);
|
|
26
|
-
const { href } = new url_1.URL(filename, url);
|
|
27
|
-
return href;
|
|
28
|
-
};
|
|
29
|
-
const parseZipContainingPage = (html) => {
|
|
30
|
-
const $ = (0, cheerio_1.load)(html);
|
|
31
|
-
const $links = $('a');
|
|
32
|
-
const links = Array.from($links)
|
|
33
|
-
.map((link) => $(link).attr('href'))
|
|
34
|
-
.filter(Boolean);
|
|
35
|
-
const zipFilename = links.find((link) => link.endsWith('.zip'));
|
|
36
|
-
if (typeof zipFilename === 'undefined') {
|
|
37
|
-
throw new Error('Cannot find link to zip file on the page');
|
|
38
|
-
}
|
|
39
|
-
return zipFilename;
|
|
40
|
-
};
|
|
41
|
-
exports.default = getPlPlWordList;
|
package/build/getRoRoWordList.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const types_1 = require("@scrabble-solver/types");
|
|
4
|
-
const lib_1 = require("./lib");
|
|
5
|
-
const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/scrabble-dictionaries/master/romanian/loc-5.0.txt';
|
|
6
|
-
const getRoRoWordList = async () => {
|
|
7
|
-
const words = await (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.RO_RO);
|
|
8
|
-
return (0, lib_1.latinizeDiacritics)(words);
|
|
9
|
-
};
|
|
10
|
-
exports.default = getRoRoWordList;
|