scrabble-solver 2.9.0 → 2.9.2
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/.eslintignore +4 -2
- package/.eslintrc.js +8 -1
- package/LICENSE +1 -1
- package/README.md +50 -30
- package/img/logo.svg +76 -0
- package/lerna.json +1 -1
- package/package.json +3 -3
- package/packages/configs/package.json +5 -5
- package/packages/constants/package.json +3 -3
- package/packages/dictionaries/build/constants/index.js +1 -1
- package/packages/dictionaries/package-lock.json +2 -2
- package/packages/dictionaries/package.json +6 -6
- package/packages/dictionaries/src/constants/index.ts +1 -1
- package/packages/logger/package-lock.json +2 -2
- package/packages/logger/package.json +5 -4
- package/packages/logger/scripts/stats.js +52 -0
- package/packages/scrabble-solver/.next/BUILD_ID +1 -1
- package/packages/scrabble-solver/.next/build-manifest.json +8 -8
- package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
- package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
- package/packages/scrabble-solver/.next/cache/next-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
- package/packages/scrabble-solver/.next/required-server-files.json +1 -1
- package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
- package/packages/scrabble-solver/.next/server/chunks/413.js +7 -3
- package/packages/scrabble-solver/.next/server/chunks/44.js +895 -4
- package/packages/scrabble-solver/.next/server/chunks/515.js +15 -6
- package/packages/scrabble-solver/.next/server/chunks/865.js +230 -116
- package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.html +2 -2
- package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/500.html +2 -2
- package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/_error.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +121 -65
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.html +2 -2
- package/packages/scrabble-solver/.next/server/pages/index.js +5 -1
- package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
- package/packages/scrabble-solver/.next/static/{BiJ0RS1mh1CdONVQg_p20 → Ntg-ilwD7GqTIFwRpSaTQ}/_buildManifest.js +1 -1
- package/packages/scrabble-solver/.next/static/{BiJ0RS1mh1CdONVQg_p20 → Ntg-ilwD7GqTIFwRpSaTQ}/_ssgManifest.js +0 -0
- package/packages/scrabble-solver/.next/static/chunks/317-5e5334962dd7c681.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/{_app-1878e12521f2d115.js → _app-183f598b1d4d480b.js} +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/{index-14d33636a0746c22.js → index-b1ffeaddd9fb64b5.js} +1 -1
- package/packages/scrabble-solver/.next/static/css/e8de67ad5ea35427.css +1 -0
- package/packages/scrabble-solver/.next/trace +52 -52
- package/packages/scrabble-solver/package-lock.json +2 -2
- package/packages/scrabble-solver/package.json +10 -10
- package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +2 -7
- package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.module.scss +1 -1
- package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +4 -1
- package/packages/scrabble-solver/src/components/Board/components/Cell/CellPure.tsx +12 -1
- package/packages/scrabble-solver/src/components/Dictionary/Dictionary.module.scss +1 -0
- package/packages/scrabble-solver/src/components/Dictionary/Dictionary.tsx +7 -2
- package/packages/scrabble-solver/src/components/Splash/Splash.module.scss +1 -1
- package/packages/scrabble-solver/src/i18n/en.json +2 -2
- package/packages/scrabble-solver/src/pages/api/dictionary/[locale]/[word].ts +3 -1
- package/packages/scrabble-solver/src/pages/index.tsx +6 -1
- package/packages/scrabble-solver/src/service-worker/dictionaries/constants.ts +3 -1
- package/packages/solver/package-lock.json +2 -2
- package/packages/solver/package.json +7 -7
- package/packages/types/build/Locale.d.ts +2 -2
- package/packages/types/build/Locale.js +1 -1
- package/packages/types/build/WordDefinition.d.ts +8 -5
- package/packages/types/build/WordDefinition.js +5 -1
- package/packages/types/build/WordDefinitionJson.d.ts +7 -0
- package/packages/types/package.json +4 -4
- package/packages/types/src/Locale.ts +1 -1
- package/packages/types/src/WordDefinition.ts +13 -1
- package/packages/types/src/WordDefinitionJson.ts +7 -0
- package/packages/word-definitions/build/getWordDefinition.d.ts +1 -1
- package/packages/word-definitions/build/getWordDefinition.js +3 -3
- package/packages/word-definitions/build/lib/normalizeDefinition.js +3 -1
- package/packages/word-definitions/build/parse/parse.js +2 -2
- package/packages/word-definitions/build/parse/parseEnglish.js +7 -7
- package/packages/word-definitions/build/parse/parseFrench.js +3 -6
- package/packages/word-definitions/build/parse/parseGerman.js +54 -16
- package/packages/word-definitions/build/parse/parsePolish.js +3 -6
- package/packages/word-definitions/build/parse/parseSpanish.js +3 -6
- package/packages/word-definitions/build/types.d.ts +1 -1
- package/packages/word-definitions/package-lock.json +14 -14
- package/packages/word-definitions/package.json +4 -4
- package/packages/word-definitions/src/getWordDefinition.ts +3 -3
- package/packages/word-definitions/src/lib/normalizeDefinition.ts +4 -1
- package/packages/word-definitions/src/parse/__tests__/expected/de-DE.hm.json +4 -0
- package/packages/word-definitions/src/parse/__tests__/expected/de-DE.ho.json +9 -0
- package/packages/word-definitions/src/parse/__tests__/expected/de-DE.kolla.json +4 -0
- package/packages/word-definitions/src/parse/__tests__/expected/de-DE.vom.json +16 -0
- package/packages/word-definitions/src/parse/__tests__/expected/en-US.awe.json +1 -1
- package/packages/word-definitions/src/parse/__tests__/expected/en-US.pawn.json +1 -1
- package/packages/word-definitions/src/parse/__tests__/expected/en-US.pawnee.json +1 -1
- package/packages/word-definitions/src/parse/__tests__/expected/en-US.pean.json +1 -1
- package/packages/word-definitions/src/parse/__tests__/expected/en-US.wiz.json +1 -1
- package/packages/word-definitions/src/parse/__tests__/expected/es-ES.corma.json +1 -1
- package/packages/word-definitions/src/parse/__tests__/expected/es-ES.portero.json +1 -1
- package/packages/word-definitions/src/parse/__tests__/input/de-DE.hm.html +873 -0
- package/packages/word-definitions/src/parse/__tests__/input/de-DE.ho.html +1144 -0
- package/packages/word-definitions/src/parse/__tests__/input/de-DE.kolla.html +980 -0
- package/packages/word-definitions/src/parse/__tests__/input/de-DE.vom.html +738 -0
- package/packages/word-definitions/src/parse/parse.test.ts +4 -0
- package/packages/word-definitions/src/parse/parse.ts +2 -2
- package/packages/word-definitions/src/parse/parseEnglish.ts +8 -4
- package/packages/word-definitions/src/parse/parseFrench.ts +3 -3
- package/packages/word-definitions/src/parse/parseGerman.ts +71 -12
- package/packages/word-definitions/src/parse/parsePolish.ts +3 -3
- package/packages/word-definitions/src/parse/parseSpanish.ts +3 -3
- package/packages/word-definitions/src/types.ts +1 -1
- package/packages/word-lists/build/getDeDeWordList.js +1 -1
- package/packages/word-lists/build/getPlPlWordList.js +2 -2
- package/packages/word-lists/package-lock.json +2 -2
- package/packages/word-lists/package.json +4 -4
- package/packages/word-lists/src/getDeDeWordList.ts +1 -1
- package/packages/word-lists/src/getPlPlWordList.ts +2 -2
- package/img/logo.png +0 -0
- package/packages/scrabble-solver/.next/server/chunks/452.js +0 -894
- package/packages/scrabble-solver/.next/static/chunks/317-c5d262202c17d519.js +0 -1
- package/packages/scrabble-solver/.next/static/css/9ac903004135f4b1.css +0 -1
- package/packages/scrabble-solver/public/robots.txt +0 -4
|
@@ -10,6 +10,10 @@ export const readTestFile = (filepath: string): string => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const tests = [
|
|
13
|
+
{ locale: Locale.DE_DE, word: 'hm' },
|
|
14
|
+
{ locale: Locale.DE_DE, word: 'ho' },
|
|
15
|
+
{ locale: Locale.DE_DE, word: 'kolla' },
|
|
16
|
+
{ locale: Locale.DE_DE, word: 'vom' },
|
|
13
17
|
{ locale: Locale.EN_US, word: 'awe' },
|
|
14
18
|
{ locale: Locale.EN_US, word: 'pawn' },
|
|
15
19
|
{ locale: Locale.EN_US, word: 'pawnee' },
|
|
@@ -19,11 +19,11 @@ const parsePerLocale: Record<Locale, (html: string) => ParseResult> = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const parse = (locale: Locale, html: string): ParseResult => {
|
|
22
|
-
const { definitions,
|
|
22
|
+
const { definitions, exists } = parsePerLocale[locale](html);
|
|
23
23
|
|
|
24
24
|
return {
|
|
25
25
|
definitions: unique(definitions.map(normalizeDefinition).filter(Boolean)),
|
|
26
|
-
|
|
26
|
+
exists,
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
2
|
|
|
3
3
|
import { ParseResult } from '../types';
|
|
4
4
|
|
|
5
|
+
const DOES_NOT_EXIST_MESSAGE =
|
|
6
|
+
// eslint-disable-next-line max-len
|
|
7
|
+
"The word you've entered isn't in the dictionary. Click on a spelling suggestion below or try again using the search bar above.";
|
|
8
|
+
|
|
5
9
|
const parseEnglish = (html: string): ParseResult => {
|
|
6
|
-
const $ =
|
|
10
|
+
const $ = load(html);
|
|
7
11
|
$('strong.mw_t_bc').replaceWith(', ');
|
|
8
12
|
$('.text-lowercase').remove();
|
|
9
13
|
$('[id^=dictionary-entry]').find('.dtText > *:not(a)').remove();
|
|
10
14
|
const $definitions = $('[id^=dictionary-entry]').find('.dtText, .cxl-ref');
|
|
11
15
|
|
|
12
16
|
return {
|
|
13
|
-
definitions: Array.from($definitions).map((definition) => $(definition).text()),
|
|
14
|
-
|
|
17
|
+
definitions: Array.from($definitions).map((definition) => $(definition).text().replace(/\n/g, '')),
|
|
18
|
+
exists: $('.spelling-suggestion-text').text().trim() !== DOES_NOT_EXIST_MESSAGE,
|
|
15
19
|
};
|
|
16
20
|
};
|
|
17
21
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
2
|
|
|
3
3
|
import { ParseResult } from '../types';
|
|
4
4
|
|
|
5
5
|
const parseFrench = (html: string): ParseResult => {
|
|
6
|
-
const $ =
|
|
6
|
+
const $ = load(html);
|
|
7
7
|
const $definitions = $('.tlf_cdefinition');
|
|
8
8
|
|
|
9
9
|
return {
|
|
10
10
|
definitions: Array.from($definitions).map((definition) => $(definition).text()),
|
|
11
|
-
|
|
11
|
+
exists: $('#vitemselected span').length > 0,
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
|
|
@@ -1,21 +1,80 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Cheerio, CheerioAPI, Element, load } from 'cheerio';
|
|
2
2
|
|
|
3
3
|
import { ParseResult } from '../types';
|
|
4
4
|
|
|
5
5
|
const parseGerman = (html: string): ParseResult => {
|
|
6
|
-
const $ =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const $ = load(html);
|
|
7
|
+
|
|
8
|
+
const definitions = [parseBedeutungsubersicht, parseBedeutungen, parseBedeutung].reduce<string[]>(
|
|
9
|
+
(results, parse) => (results.length === 0 ? parse($) : results),
|
|
10
|
+
[],
|
|
11
|
+
);
|
|
12
|
+
const exists = Array.from($('.label-danger')).every((label) => $(label).text() !== 'Hinweis');
|
|
13
|
+
|
|
14
|
+
return { definitions, exists };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const parseBedeutungsubersicht = ($: CheerioAPI): string[] => {
|
|
18
|
+
Array.from($('.bedeutungsuebersicht ol > li > a')).forEach((item) => {
|
|
19
|
+
$(item).text($(item).text().replace(/\n/g, ''));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
Array.from($('.bedeutungsuebersicht ol > li > ol > li')).forEach((item) => {
|
|
23
|
+
const text = `\n${$(item).text().replace(/\n/g, '')}`;
|
|
24
|
+
const $text = $(`<div>${text}</div>`);
|
|
25
|
+
$(item).replaceWith($text);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
Array.from($('.bedeutungsuebersicht ol > li > ol')).forEach((list) => {
|
|
29
|
+
const $list = $(list);
|
|
30
|
+
const html = $list.html() || '';
|
|
31
|
+
const $html = $(`<div>${html}</div>`);
|
|
32
|
+
const $prev = $list.prev('a');
|
|
33
|
+
|
|
34
|
+
if ($prev) {
|
|
35
|
+
$prev.append($html);
|
|
36
|
+
$(list).remove();
|
|
37
|
+
} else {
|
|
38
|
+
$(list).replaceWith($html);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return parseDefinitions($, $('.bedeutungsuebersicht ol > li'));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const parseBedeutung = ($: CheerioAPI): string[] => {
|
|
46
|
+
return parseDefinitions($, $('.dwdswb-lesart .dwdswb-definition-spezifizierung'));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const parseBedeutungen = ($: CheerioAPI): string[] => {
|
|
50
|
+
const definitions = parseDefinitions($, $('.dwdswb-lesart .dwdswb-definition'));
|
|
51
|
+
|
|
52
|
+
if (definitions.length > 0) {
|
|
53
|
+
return definitions;
|
|
13
54
|
}
|
|
14
55
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
56
|
+
const $references = $('.dwdswb-lesart .dwdswb-verweis');
|
|
57
|
+
const references = Array.from($references).reduce<string[]>((result, reference) => {
|
|
58
|
+
const html = reference.attribs['data-content'] || '<span />';
|
|
59
|
+
const values = $(html)
|
|
60
|
+
.text()
|
|
61
|
+
.split(';')
|
|
62
|
+
.map((value) => value.trim());
|
|
63
|
+
|
|
64
|
+
return result.concat(values);
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
67
|
+
return references;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const parseDefinitions = ($: CheerioAPI, $definitions: Cheerio<Element>) => {
|
|
71
|
+
return Array.from($definitions).map((definition) =>
|
|
72
|
+
$(definition)
|
|
73
|
+
.text()
|
|
74
|
+
.replace(/[ ]+/g, ' ')
|
|
75
|
+
.replace(/[ ]\n/g, '\n')
|
|
76
|
+
.replace(/^[0-9]+\.\s/g, ''),
|
|
77
|
+
);
|
|
19
78
|
};
|
|
20
79
|
|
|
21
80
|
export default parseGerman;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
2
|
|
|
3
3
|
import { ParseResult } from '../types';
|
|
4
4
|
|
|
5
5
|
const parsePolish = (html: string): ParseResult => {
|
|
6
|
-
const $ =
|
|
6
|
+
const $ = load(html);
|
|
7
7
|
const $header = $($('h1')[0]);
|
|
8
8
|
const $isAllowed = $header.next();
|
|
9
9
|
const $definitions = $header.next().next().next().next();
|
|
10
10
|
|
|
11
11
|
return {
|
|
12
12
|
definitions: $definitions.text().trim().split(/\d+\./),
|
|
13
|
-
|
|
13
|
+
exists: $isAllowed.text().trim().indexOf('dopuszczalne w grach') >= 0,
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
2
|
|
|
3
3
|
import { ParseResult } from '../types';
|
|
4
4
|
|
|
5
5
|
const parseSpanish = (html: string): ParseResult => {
|
|
6
|
-
const $ =
|
|
6
|
+
const $ = load(html);
|
|
7
7
|
$('.verdBold14 + .gris11 + .gris13').remove();
|
|
8
8
|
$('br + .gris13').remove();
|
|
9
9
|
$('.grisItalic13 + .gris13').remove();
|
|
@@ -28,7 +28,7 @@ const parseSpanish = (html: string): ParseResult => {
|
|
|
28
28
|
.filter(Boolean)
|
|
29
29
|
.map((definition) => definition.replace(/\s+\.$/g, ''))
|
|
30
30
|
.map((definition) => (definition.endsWith('.') ? definition : `${definition}.`)),
|
|
31
|
-
|
|
31
|
+
exists: $('.wrapper > p > strong').text() !== 'No se ha encontrado la palabra exacta',
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const lib_1 = require("./lib");
|
|
4
|
-
const FILE_URL = 'https://raw.githubusercontent.com/
|
|
4
|
+
const FILE_URL = 'https://raw.githubusercontent.com/hippler/german-wordlist/master/words.txt';
|
|
5
5
|
const getDeDeWordList = async () => {
|
|
6
6
|
return (0, lib_1.getTxtWordList)(FILE_URL);
|
|
7
7
|
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const cheerio_1 =
|
|
6
|
+
const cheerio_1 = require("cheerio");
|
|
7
7
|
const memfs_1 = require("memfs");
|
|
8
8
|
const unzipper_1 = __importDefault(require("unzipper"));
|
|
9
9
|
const url_1 = require("url");
|
|
@@ -28,7 +28,7 @@ const fetchZipUrl = async (url) => {
|
|
|
28
28
|
return href;
|
|
29
29
|
};
|
|
30
30
|
const parseZipContainingPage = (html) => {
|
|
31
|
-
const $ = cheerio_1.
|
|
31
|
+
const $ = (0, cheerio_1.load)(html);
|
|
32
32
|
const $links = $('a');
|
|
33
33
|
const links = Array.from($links)
|
|
34
34
|
.map((link) => $(link).attr('href'))
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/word-lists",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@scrabble-solver/word-lists",
|
|
9
|
-
"version": "2.9.
|
|
9
|
+
"version": "2.9.2",
|
|
10
10
|
"license": "CC-BY-NC-ND-4.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cheerio": "^1.0.0-rc.12",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/word-lists",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Scrabble Solver 2 - Word lists",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"author": {
|
|
12
12
|
"name": "Kamil Mielnik",
|
|
13
|
-
"email": "kamil
|
|
14
|
-
"url": "https://kamilmielnik.com
|
|
13
|
+
"email": "kamil@kamilmielnik.com",
|
|
14
|
+
"url": "https://kamilmielnik.com"
|
|
15
15
|
},
|
|
16
16
|
"license": "CC-BY-NC-ND-4.0",
|
|
17
17
|
"bugs": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"clean:force": "npm run clean && rimraf package-lock.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@scrabble-solver/types": "^2.9.
|
|
27
|
+
"@scrabble-solver/types": "^2.9.2",
|
|
28
28
|
"cheerio": "^1.0.0-rc.12",
|
|
29
29
|
"follow-redirects": "^1.15.2",
|
|
30
30
|
"memfs": "^3.4.7",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getTxtWordList } from './lib';
|
|
2
2
|
|
|
3
|
-
const FILE_URL = 'https://raw.githubusercontent.com/
|
|
3
|
+
const FILE_URL = 'https://raw.githubusercontent.com/hippler/german-wordlist/master/words.txt';
|
|
4
4
|
|
|
5
5
|
const getDeDeWordList = async (): Promise<string[]> => {
|
|
6
6
|
return getTxtWordList(FILE_URL);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
2
|
import { fs } from 'memfs';
|
|
3
3
|
import unzipper from 'unzipper';
|
|
4
4
|
import { URL } from 'url';
|
|
@@ -28,7 +28,7 @@ const fetchZipUrl = async (url: string): Promise<string> => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const parseZipContainingPage = (html: string): string => {
|
|
31
|
-
const $ =
|
|
31
|
+
const $ = load(html);
|
|
32
32
|
const $links = $('a');
|
|
33
33
|
const links = Array.from($links)
|
|
34
34
|
.map((link) => $(link).attr('href'))
|
package/img/logo.png
DELETED
|
Binary file
|