@scrabble-solver/scrabble-solver 2.9.2 → 2.10.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.
Files changed (120) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +11 -11
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_8dgz12 +1 -1
  5. package/.next/cache/next-server.js.nft.json +1 -1
  6. package/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  9. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  10. package/.next/cache/webpack/server-production/0.pack +0 -0
  11. package/.next/cache/webpack/server-production/index.pack +0 -0
  12. package/.next/next-server.js.nft.json +1 -1
  13. package/.next/prerender-manifest.json +1 -1
  14. package/.next/routes-manifest.json +1 -1
  15. package/.next/server/chunks/{429.js → 131.js} +2 -3652
  16. package/.next/server/chunks/413.js +367 -185
  17. package/.next/server/chunks/44.js +71 -45
  18. package/.next/server/chunks/515.js +1135 -504
  19. package/.next/server/chunks/911.js +96 -2
  20. package/.next/server/middleware-build-manifest.js +1 -1
  21. package/.next/server/pages/404.html +2 -2
  22. package/.next/server/pages/404.js.nft.json +1 -1
  23. package/.next/server/pages/500.html +2 -2
  24. package/.next/server/pages/_app.js.nft.json +1 -1
  25. package/.next/server/pages/_error.js.nft.json +1 -1
  26. package/.next/server/pages/api/dictionary/[locale]/[word].js +48 -10
  27. package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
  28. package/.next/server/pages/api/dictionary/[locale].js +1 -8
  29. package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
  30. package/.next/server/pages/api/solve.js +62 -49
  31. package/.next/server/pages/api/solve.js.nft.json +1 -1
  32. package/.next/server/pages/api/verify.js +2 -9
  33. package/.next/server/pages/api/verify.js.nft.json +1 -1
  34. package/.next/server/pages/index.html +4 -8
  35. package/.next/server/pages/index.js +43 -36
  36. package/.next/server/pages/index.js.nft.json +1 -1
  37. package/.next/server/pages/index.json +1 -1
  38. package/.next/server/pages-manifest.json +2 -2
  39. package/.next/static/chunks/368-d423e70be6c0c473.js +1 -0
  40. package/.next/static/chunks/pages/{404-7082923654d5996f.js → 404-932294135c3206dd.js} +1 -1
  41. package/.next/static/chunks/pages/_app-3f5508a5f544d9eb.js +1 -0
  42. package/.next/static/chunks/pages/index-8af7a9d7a2cd98a7.js +1 -0
  43. package/.next/static/css/6b1833fd19d3a74a.css +1 -0
  44. package/.next/static/css/a6154e4ca046ca13.css +1 -0
  45. package/.next/static/css/bad53af6f8616677.css +1 -0
  46. package/.next/static/vscqn7BEtAxJteWSwNnas/_buildManifest.js +1 -0
  47. package/.next/static/{Ntg-ilwD7GqTIFwRpSaTQ → vscqn7BEtAxJteWSwNnas}/_ssgManifest.js +0 -0
  48. package/.next/trace +52 -52
  49. package/package.json +9 -9
  50. package/src/components/Board/components/Cell/Cell.module.scss +45 -9
  51. package/src/components/Board/hooks/useGrid.ts +4 -2
  52. package/src/components/Dictionary/Dictionary.module.scss +8 -1
  53. package/src/components/EmptyState/EmptyState.tsx +6 -2
  54. package/src/components/Loading/Loading.tsx +13 -2
  55. package/src/components/Logo/Logo.svg +62 -0
  56. package/src/components/Logo/index.ts +1 -1
  57. package/src/components/NavButtons/NavButtons.module.scss +8 -7
  58. package/src/components/NavButtons/NavButtons.tsx +35 -28
  59. package/src/components/PlainTiles/PlainTiles.tsx +7 -1
  60. package/src/components/PlainTiles/Tile.tsx +4 -3
  61. package/src/components/Rack/Rack.tsx +4 -2
  62. package/src/components/Radio/Radio.module.scss +1 -1
  63. package/src/components/RemainingTiles/Character.tsx +7 -2
  64. package/src/components/RemainingTiles/RemainingTiles.tsx +28 -20
  65. package/src/components/Results/Cell.tsx +5 -3
  66. package/src/components/Results/Result.tsx +8 -3
  67. package/src/components/Results/Results.module.scss +31 -9
  68. package/src/components/Results/Results.tsx +6 -2
  69. package/src/components/Results/getColumns.ts +58 -0
  70. package/src/components/Settings/components/ConfigSetting/ConfigSetting.module.scss +1 -0
  71. package/src/components/Settings/components/LocaleSetting/LocaleSetting.module.scss +12 -1
  72. package/src/components/Settings/components/LocaleSetting/LocaleSetting.tsx +1 -1
  73. package/src/components/Settings/components/LocaleSetting/options.ts +7 -1
  74. package/src/components/Sidebar/Sidebar.module.scss +42 -8
  75. package/src/components/SvgFontCss/SvgFontCss.tsx +8 -7
  76. package/src/components/SvgFontCss/createCss.ts +11 -0
  77. package/src/components/SvgFontCss/createStyle.ts +9 -0
  78. package/src/components/SvgFontCss/createSvg.ts +10 -0
  79. package/src/components/SvgFontFix/SvgFontFix.module.scss +5 -0
  80. package/src/components/SvgFontFix/SvgFontFix.tsx +21 -0
  81. package/src/components/SvgFontFix/index.ts +1 -0
  82. package/src/components/Tile/Tile.module.scss +10 -2
  83. package/src/components/Tile/Tile.tsx +4 -0
  84. package/src/components/Tile/TilePure.tsx +3 -1
  85. package/src/components/Words/Words.tsx +4 -3
  86. package/src/components/index.ts +1 -0
  87. package/src/hooks/index.ts +2 -0
  88. package/src/hooks/useDirection.ts +22 -0
  89. package/src/hooks/useLanguage.ts +22 -0
  90. package/src/i18n/constants.ts +53 -0
  91. package/src/i18n/fa.json +56 -0
  92. package/src/i18n/i18n.ts +22 -0
  93. package/src/i18n/index.ts +2 -20
  94. package/src/icons/FlagFa.svg +95 -0
  95. package/src/icons/index.ts +1 -0
  96. package/src/lib/createComparator.ts +22 -0
  97. package/src/lib/createKeyComparator.ts +4 -2
  98. package/src/lib/createStringComparator.ts +5 -0
  99. package/src/lib/detectLocale.ts +4 -0
  100. package/src/lib/getRemainingTiles.ts +4 -2
  101. package/src/lib/getRemainingTilesGroups.ts +48 -23
  102. package/src/lib/index.ts +2 -2
  103. package/src/lib/sortResults.ts +11 -9
  104. package/src/lib/unorderedArraysEqual.ts +3 -2
  105. package/src/pages/api/verify.ts +1 -1
  106. package/src/pages/index.module.scss +7 -18
  107. package/src/pages/index.tsx +10 -2
  108. package/src/service-worker/routeVerifyRequests.ts +1 -1
  109. package/src/state/selectors.ts +5 -5
  110. package/src/styles/global.scss +6 -1
  111. package/.next/static/Ntg-ilwD7GqTIFwRpSaTQ/_buildManifest.js +0 -1
  112. package/.next/static/chunks/317-5e5334962dd7c681.js +0 -1
  113. package/.next/static/chunks/pages/_app-183f598b1d4d480b.js +0 -1
  114. package/.next/static/chunks/pages/index-b1ffeaddd9fb64b5.js +0 -1
  115. package/.next/static/css/751e8a14776d05d8.css +0 -1
  116. package/.next/static/css/ad2a08918868cad8.css +0 -1
  117. package/.next/static/css/e8de67ad5ea35427.css +0 -1
  118. package/src/components/Results/constants.ts +0 -42
  119. package/src/lib/comparator.ts +0 -16
  120. package/src/lib/stringComparator.ts +0 -5
@@ -869,6 +869,7 @@ var Locale;
869
869
  Locale["EN_GB"] = "en-GB";
870
870
  Locale["EN_US"] = "en-US";
871
871
  Locale["ES_ES"] = "es-ES";
872
+ Locale["FA_IR"] = "fa-IR";
872
873
  Locale["FR_FR"] = "fr-FR";
873
874
  Locale["PL_PL"] = "pl-PL";
874
875
  })(Locale || (Locale = {}));
@@ -958,7 +959,6 @@ class Result {
958
959
  this.points = points;
959
960
  this.pointsRatio = getPointsRatio(tiles, points);
960
961
  this.tiles = tiles;
961
- this.tilesCharacters = getTilesCharacters(tiles);
962
962
  this.tilesCount = tiles.length;
963
963
  this.vowelsCount = getVowels(tiles).length;
964
964
  this.word = getWord(cells);
@@ -982,15 +982,11 @@ class Result {
982
982
  };
983
983
  }
984
984
  }
985
- const charactersComparator = (a, b) => a.localeCompare(b);
986
985
  const getBlanks = (tiles) => tiles.filter(({ isBlank }) => isBlank);
987
986
  const getConsonants = (tiles) => tiles.filter(isConsonant);
988
987
  const getVowels = (tiles) => tiles.filter(isVowel);
989
- const getNonBlankCharacters = (tiles) => getNonBlanks(tiles).map(({ character }) => character);
990
- const getNonBlanks = (tiles) => tiles.filter(({ isBlank }) => !isBlank);
991
988
  const getPointsRatio = (tiles, points) => points / tiles.length;
992
989
  const getTiles = (cells) => cells.filter(({ isEmpty }) => isEmpty).map(({ tile }) => tile);
993
- const getTilesCharacters = (tiles) => getNonBlankCharacters(tiles).sort(charactersComparator).join('');
994
990
  // eslint-disable-next-line prefer-template
995
991
  const getWord = (cells) => cells.reduce((word, cell) => word + cell.toString(), '');
996
992
  const getWords = (cells, collisions) => [cells, ...collisions].map(getWord);
@@ -1275,10 +1271,11 @@ exports["default"] = isObject;
1275
1271
 
1276
1272
 
1277
1273
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1274
+ const types_1 = __webpack_require__(46452);
1278
1275
  const lib_1 = __webpack_require__(60337);
1279
1276
  const FILE_URL = 'https://raw.githubusercontent.com/hippler/german-wordlist/master/words.txt';
1280
1277
  const getDeDeWordList = async () => {
1281
- return (0, lib_1.getTxtWordList)(FILE_URL);
1278
+ return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.DE_DE);
1282
1279
  };
1283
1280
  exports["default"] = getDeDeWordList;
1284
1281
 
@@ -1290,10 +1287,11 @@ exports["default"] = getDeDeWordList;
1290
1287
 
1291
1288
 
1292
1289
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1290
+ const types_1 = __webpack_require__(46452);
1293
1291
  const lib_1 = __webpack_require__(60337);
1294
1292
  const FILE_URL = 'https://www.wordgamedictionary.com/sowpods/download/sowpods.txt';
1295
1293
  const getEnGbWordList = async () => {
1296
- return (0, lib_1.getTxtWordList)(FILE_URL);
1294
+ return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.EN_GB);
1297
1295
  };
1298
1296
  exports["default"] = getEnGbWordList;
1299
1297
 
@@ -1305,10 +1303,11 @@ exports["default"] = getEnGbWordList;
1305
1303
 
1306
1304
 
1307
1305
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1306
+ const types_1 = __webpack_require__(46452);
1308
1307
  const lib_1 = __webpack_require__(60337);
1309
1308
  const FILE_URL = 'https://www.wordgamedictionary.com/twl06/download/twl06.txt';
1310
1309
  const getEnUsWordList = async () => {
1311
- return (0, lib_1.getTxtWordList)(FILE_URL);
1310
+ return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.EN_US);
1312
1311
  };
1313
1312
  exports["default"] = getEnUsWordList;
1314
1313
 
@@ -1320,10 +1319,11 @@ exports["default"] = getEnUsWordList;
1320
1319
 
1321
1320
 
1322
1321
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1322
+ const types_1 = __webpack_require__(46452);
1323
1323
  const lib_1 = __webpack_require__(60337);
1324
1324
  const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/fise-2/master/fise-2.txt';
1325
1325
  const getEsEsWordList = async () => {
1326
- const words = await (0, lib_1.getTxtWordList)(FILE_URL);
1326
+ const words = await (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.ES_ES);
1327
1327
  return words.map(normalizeWord);
1328
1328
  };
1329
1329
  const normalizeWord = (word) => {
@@ -1333,6 +1333,22 @@ const normalizeWord = (word) => {
1333
1333
  exports["default"] = getEsEsWordList;
1334
1334
 
1335
1335
 
1336
+ /***/ }),
1337
+
1338
+ /***/ 29596:
1339
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1340
+
1341
+
1342
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1343
+ const types_1 = __webpack_require__(46452);
1344
+ const lib_1 = __webpack_require__(60337);
1345
+ const FILE_URL = 'https://raw.githubusercontent.com/MansourM/persian-to-persian-dictionary/main/moein/words.txt';
1346
+ const getFaIrWordList = async () => {
1347
+ return (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.FA_IR);
1348
+ };
1349
+ exports["default"] = getFaIrWordList;
1350
+
1351
+
1336
1352
  /***/ }),
1337
1353
 
1338
1354
  /***/ 27098:
@@ -1340,12 +1356,13 @@ exports["default"] = getEsEsWordList;
1340
1356
 
1341
1357
 
1342
1358
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1359
+ const types_1 = __webpack_require__(46452);
1343
1360
  const lib_1 = __webpack_require__(60337);
1344
1361
  const FILE_URL =
1345
1362
  // eslint-disable-next-line max-len
1346
1363
  'https://raw.githubusercontent.com/hbenbel/French-Dictionary/a573eab10cc798d7d5da7daab4d2ac0259bb46a3/dictionary/dictionary.txt';
1347
1364
  const getFrFrWordList = async () => {
1348
- const words = await (0, lib_1.getTxtWordList)(FILE_URL);
1365
+ const words = await (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.FR_FR);
1349
1366
  return words.map(normalizeWord);
1350
1367
  };
1351
1368
  const normalizeWord = (word) => {
@@ -1366,21 +1383,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1366
1383
  };
1367
1384
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1368
1385
  const cheerio_1 = __webpack_require__(55473);
1369
- const memfs_1 = __webpack_require__(28098);
1386
+ const fs_1 = __importDefault(__webpack_require__(57147));
1370
1387
  const unzipper_1 = __importDefault(__webpack_require__(23428));
1371
1388
  const url_1 = __webpack_require__(57310);
1372
1389
  const lib_1 = __webpack_require__(60337);
1373
1390
  const PAGE_URL = 'https://sjp.pl/sl/growy/';
1374
1391
  const FILE_TO_EXTRACT_FROM_ZIP = 'slowa.txt';
1375
1392
  const getPlPlWordList = async () => {
1376
- const tempFilename = (0, lib_1.getTempFilename)();
1393
+ const tempFilepath = (0, lib_1.getTempFilepath)();
1377
1394
  const zipUrl = await fetchZipUrl(PAGE_URL);
1378
1395
  const zipTempFilename = await (0, lib_1.downloadFile)(zipUrl);
1379
- await unzip(zipTempFilename, tempFilename);
1380
- memfs_1.fs.unlinkSync(zipTempFilename);
1381
- const file = memfs_1.fs.readFileSync(tempFilename, 'utf-8');
1382
- memfs_1.fs.unlinkSync(tempFilename);
1383
- const words = (0, lib_1.extractWords)(file.toLocaleString());
1396
+ await unzip(zipTempFilename, tempFilepath);
1397
+ fs_1.default.unlinkSync(zipTempFilename);
1398
+ const file = fs_1.default.readFileSync(tempFilepath, 'utf-8');
1399
+ fs_1.default.unlinkSync(tempFilepath);
1400
+ const words = (0, lib_1.extractWords)(file.toLocaleString(), 'pl-PL');
1384
1401
  return words;
1385
1402
  };
1386
1403
  const fetchZipUrl = async (url) => {
@@ -1402,13 +1419,13 @@ const parseZipContainingPage = (html) => {
1402
1419
  return zipFilename;
1403
1420
  };
1404
1421
  const unzip = (zipFilename, outputFilename) => {
1405
- return memfs_1.fs
1422
+ return fs_1.default
1406
1423
  .createReadStream(zipFilename)
1407
1424
  .pipe(unzipper_1.default.Parse())
1408
1425
  .on('entry', (entry) => {
1409
1426
  const fileName = entry.path;
1410
1427
  if (fileName === FILE_TO_EXTRACT_FROM_ZIP) {
1411
- entry.pipe(memfs_1.fs.createWriteStream(outputFilename));
1428
+ entry.pipe(fs_1.default.createWriteStream(outputFilename));
1412
1429
  }
1413
1430
  else {
1414
1431
  entry.autodrain();
@@ -1434,6 +1451,7 @@ const getDeDeWordList_1 = __importDefault(__webpack_require__(61704));
1434
1451
  const getEnGbWordList_1 = __importDefault(__webpack_require__(3284));
1435
1452
  const getEnUsWordList_1 = __importDefault(__webpack_require__(163));
1436
1453
  const getEsEsWordList_1 = __importDefault(__webpack_require__(87537));
1454
+ const getFaIrWordList_1 = __importDefault(__webpack_require__(29596));
1437
1455
  const getFrFrWordList_1 = __importDefault(__webpack_require__(27098));
1438
1456
  const getPlPlWordList_1 = __importDefault(__webpack_require__(81848));
1439
1457
  const localeMap = {
@@ -1441,6 +1459,7 @@ const localeMap = {
1441
1459
  [types_1.Locale.EN_GB]: getEnGbWordList_1.default,
1442
1460
  [types_1.Locale.EN_US]: getEnUsWordList_1.default,
1443
1461
  [types_1.Locale.ES_ES]: getEsEsWordList_1.default,
1462
+ [types_1.Locale.FA_IR]: getFaIrWordList_1.default,
1444
1463
  [types_1.Locale.FR_FR]: getFrFrWordList_1.default,
1445
1464
  [types_1.Locale.PL_PL]: getPlPlWordList_1.default,
1446
1465
  };
@@ -1499,13 +1518,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1499
1518
  };
1500
1519
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1501
1520
  const follow_redirects_1 = __webpack_require__(24396);
1502
- const memfs_1 = __webpack_require__(28098);
1503
- const getTempFilename_1 = __importDefault(__webpack_require__(52688));
1521
+ const fs_1 = __importDefault(__webpack_require__(57147));
1522
+ const getTempFilepath_1 = __importDefault(__webpack_require__(5026));
1504
1523
  const downloadFile = (url) => {
1505
1524
  return new Promise((resolve, reject) => {
1506
- const tempFilename = (0, getTempFilename_1.default)();
1525
+ const tempFilepath = (0, getTempFilepath_1.default)();
1507
1526
  const protocol = url.startsWith('https') ? follow_redirects_1.https : follow_redirects_1.http;
1508
- const writeStream = memfs_1.fs.createWriteStream(tempFilename);
1527
+ const writeStream = fs_1.default.createWriteStream(tempFilepath);
1509
1528
  const request = protocol.get(url, (response) => {
1510
1529
  if (typeof response.statusCode === 'undefined' || response.statusCode >= 400) {
1511
1530
  reject(new Error(`Cannot download file: ${url}`));
@@ -1518,7 +1537,7 @@ const downloadFile = (url) => {
1518
1537
  response.on('end', () => {
1519
1538
  writeStream.on('finish', () => {
1520
1539
  writeStream.close();
1521
- resolve(tempFilename);
1540
+ resolve(tempFilepath);
1522
1541
  });
1523
1542
  });
1524
1543
  response.pipe(writeStream);
@@ -1570,13 +1589,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1570
1589
  };
1571
1590
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1572
1591
  const findFirstWordIndex_1 = __importDefault(__webpack_require__(47669));
1573
- const extractWords = (file) => {
1574
- const lines = file.replace(/\r/g, '').split('\n');
1575
- const firstWordIndex = (0, findFirstWordIndex_1.default)(lines);
1576
- const words = lines
1577
- .slice(firstWordIndex)
1578
- .filter((word) => word.trim().length > 0)
1579
- .map((word) => word.toLocaleLowerCase());
1592
+ const extractWords = (file, locale) => {
1593
+ const lines = file.split(/\r?\n/g);
1594
+ const firstWordIndex = (0, findFirstWordIndex_1.default)(lines, locale);
1595
+ const words = [];
1596
+ for (let i = firstWordIndex; i < lines.length; ++i) {
1597
+ const trimmed = lines[i].trim();
1598
+ if (trimmed.length > 0) {
1599
+ words.push(trimmed.toLocaleLowerCase());
1600
+ }
1601
+ }
1580
1602
  return words;
1581
1603
  };
1582
1604
  exports["default"] = extractWords;
@@ -1589,10 +1611,10 @@ exports["default"] = extractWords;
1589
1611
 
1590
1612
 
1591
1613
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1592
- const findFirstWordIndex = (lines) => {
1614
+ const findFirstWordIndex = (lines, locale) => {
1593
1615
  const firstWordIndex = lines.findIndex((line, index) => {
1594
1616
  const nextLine = line[index + 1] || '';
1595
- const isNextLineInOrder = line.localeCompare(nextLine) === 1;
1617
+ const isNextLineInOrder = line.localeCompare(nextLine, locale) > 0;
1596
1618
  const hasWhitespace = Boolean(line.match(/\s/));
1597
1619
  const isEmpty = line.trim().length === 0;
1598
1620
  return !isEmpty && !hasWhitespace && isNextLineInOrder;
@@ -1622,7 +1644,7 @@ exports["default"] = getHash;
1622
1644
 
1623
1645
  /***/ }),
1624
1646
 
1625
- /***/ 52688:
1647
+ /***/ 5026:
1626
1648
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1627
1649
 
1628
1650
 
@@ -1630,11 +1652,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1630
1652
  return (mod && mod.__esModule) ? mod : { "default": mod };
1631
1653
  };
1632
1654
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1655
+ const os_1 = __importDefault(__webpack_require__(22037));
1656
+ const path_1 = __importDefault(__webpack_require__(71017));
1633
1657
  const getHash_1 = __importDefault(__webpack_require__(93938));
1634
- const getTempFilename = () => {
1635
- return `/${(0, getHash_1.default)()}.txt`;
1658
+ const OUTPUT_DIRECTORY = path_1.default.resolve(os_1.default.homedir(), '.scrabble-solver');
1659
+ const getTempFilepath = () => {
1660
+ const filename = `${(0, getHash_1.default)()}.txt`;
1661
+ return path_1.default.join(OUTPUT_DIRECTORY, filename);
1636
1662
  };
1637
- exports["default"] = getTempFilename;
1663
+ exports["default"] = getTempFilepath;
1638
1664
 
1639
1665
 
1640
1666
  /***/ }),
@@ -1647,14 +1673,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1647
1673
  return (mod && mod.__esModule) ? mod : { "default": mod };
1648
1674
  };
1649
1675
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1650
- const memfs_1 = __webpack_require__(28098);
1676
+ const fs_1 = __importDefault(__webpack_require__(57147));
1651
1677
  const downloadFile_1 = __importDefault(__webpack_require__(920));
1652
1678
  const extractWords_1 = __importDefault(__webpack_require__(39759));
1653
- const getTxtWordList = async (url) => {
1679
+ const getTxtWordList = async (url, locale) => {
1654
1680
  const tempFilename = await (0, downloadFile_1.default)(url);
1655
- const file = memfs_1.fs.readFileSync(tempFilename, 'utf-8');
1656
- const words = (0, extractWords_1.default)(file.toLocaleString());
1657
- memfs_1.fs.unlinkSync(tempFilename);
1681
+ const file = fs_1.default.readFileSync(tempFilename, 'utf-8');
1682
+ const words = (0, extractWords_1.default)(file.toLocaleString(), locale);
1683
+ fs_1.default.unlinkSync(tempFilename);
1658
1684
  return words;
1659
1685
  };
1660
1686
  exports["default"] = getTxtWordList;
@@ -1670,7 +1696,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1670
1696
  return (mod && mod.__esModule) ? mod : { "default": mod };
1671
1697
  };
1672
1698
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1673
- exports.getTxtWordList = exports.getTempFilename = exports.getHash = exports.findFirstWordIndex = exports.extractWords = exports.downloadHtml = exports.downloadFile = void 0;
1699
+ exports.getTxtWordList = exports.getTempFilepath = exports.getHash = exports.findFirstWordIndex = exports.extractWords = exports.downloadHtml = exports.downloadFile = void 0;
1674
1700
  var downloadFile_1 = __webpack_require__(920);
1675
1701
  Object.defineProperty(exports, "downloadFile", ({ enumerable: true, get: function () { return __importDefault(downloadFile_1).default; } }));
1676
1702
  var downloadHtml_1 = __webpack_require__(78015);
@@ -1681,8 +1707,8 @@ var findFirstWordIndex_1 = __webpack_require__(47669);
1681
1707
  Object.defineProperty(exports, "findFirstWordIndex", ({ enumerable: true, get: function () { return __importDefault(findFirstWordIndex_1).default; } }));
1682
1708
  var getHash_1 = __webpack_require__(93938);
1683
1709
  Object.defineProperty(exports, "getHash", ({ enumerable: true, get: function () { return __importDefault(getHash_1).default; } }));
1684
- var getTempFilename_1 = __webpack_require__(52688);
1685
- Object.defineProperty(exports, "getTempFilename", ({ enumerable: true, get: function () { return __importDefault(getTempFilename_1).default; } }));
1710
+ var getTempFilepath_1 = __webpack_require__(5026);
1711
+ Object.defineProperty(exports, "getTempFilepath", ({ enumerable: true, get: function () { return __importDefault(getTempFilepath_1).default; } }));
1686
1712
  var getTxtWordList_1 = __webpack_require__(78029);
1687
1713
  Object.defineProperty(exports, "getTxtWordList", ({ enumerable: true, get: function () { return __importDefault(getTxtWordList_1).default; } }));
1688
1714