@scrabble-solver/word-lists 2.13.5-alpha.2 → 2.13.5-alpha.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-lists",
3
- "version": "2.13.5-alpha.2",
3
+ "version": "2.13.5-alpha.4",
4
4
  "description": "Scrabble Solver 2 - Word lists",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,16 +23,16 @@
23
23
  "clean": "rimraf build/"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.13.5-alpha.2",
26
+ "@scrabble-solver/types": "^2.13.5-alpha.4",
27
27
  "cheerio": "^1.0.0-rc.12",
28
- "follow-redirects": "^1.15.5",
28
+ "follow-redirects": "^1.15.6",
29
29
  "latinize": "^1.0.0",
30
- "unzipper": "^0.10.14"
30
+ "unzipper": "^0.11.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/follow-redirects": "^1.14.4",
34
34
  "@types/latinize": "^0.2.18",
35
35
  "@types/unzipper": "^0.10.9"
36
36
  },
37
- "gitHead": "95703c052d4874a7fffcd2a296a5be4fe25b6b72"
37
+ "gitHead": "84d116ea750ff101a9fa6f30e1219780429c4a45"
38
38
  }
@@ -1,2 +0,0 @@
1
- declare const getDeDeWordList: () => Promise<string[]>;
2
- export default getDeDeWordList;
@@ -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;
@@ -1,2 +0,0 @@
1
- declare const getEnGbWordList: () => Promise<string[]>;
2
- export default getEnGbWordList;
@@ -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;
@@ -1,2 +0,0 @@
1
- declare const getEnUsWordList: () => Promise<string[]>;
2
- export default getEnUsWordList;
@@ -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;
@@ -1,2 +0,0 @@
1
- declare const getEsEsWordList: () => Promise<string[]>;
2
- export default getEsEsWordList;
@@ -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;
@@ -1,2 +0,0 @@
1
- declare const getFaIrWordList: () => Promise<string[]>;
2
- export default getFaIrWordList;
@@ -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;
@@ -1,2 +0,0 @@
1
- declare const getFrFrWordList: () => Promise<string[]>;
2
- export default getFrFrWordList;
@@ -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;
@@ -1,2 +0,0 @@
1
- declare const getPlPlWordList: () => Promise<string[]>;
2
- export default getPlPlWordList;
@@ -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;
@@ -1,2 +0,0 @@
1
- declare const getRoRoWordList: () => Promise<string[]>;
2
- export default getRoRoWordList;
@@ -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;