@scrabble-solver/configs 2.12.5 → 2.13.1

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 (69) hide show
  1. package/build/locales/index.d.ts +1 -0
  2. package/build/locales/index.js +3 -1
  3. package/build/locales/roRo.d.ts +3 -0
  4. package/build/locales/roRo.js +38 -0
  5. package/dictionaries/build/Dictionaries.d.ts +13 -0
  6. package/dictionaries/build/Dictionaries.js +46 -0
  7. package/dictionaries/build/constants/index.d.ts +3 -0
  8. package/dictionaries/build/constants/index.js +11 -0
  9. package/dictionaries/build/index.d.ts +3 -0
  10. package/dictionaries/build/index.js +23 -0
  11. package/dictionaries/build/lib/DiskCache.d.ts +11 -0
  12. package/dictionaries/build/lib/DiskCache.js +48 -0
  13. package/dictionaries/build/lib/LayeredCache.d.ts +13 -0
  14. package/dictionaries/build/lib/LayeredCache.js +55 -0
  15. package/dictionaries/build/lib/MemoryCache.d.ts +13 -0
  16. package/dictionaries/build/lib/MemoryCache.js +32 -0
  17. package/dictionaries/build/lib/createAsyncProxy.d.ts +3 -0
  18. package/dictionaries/build/lib/createAsyncProxy.js +18 -0
  19. package/dictionaries/build/lib/createCacheTimestampComparator.d.ts +5 -0
  20. package/dictionaries/build/lib/createCacheTimestampComparator.js +19 -0
  21. package/dictionaries/build/lib/downloadDictionary.d.ts +4 -0
  22. package/dictionaries/build/lib/downloadDictionary.js +16 -0
  23. package/dictionaries/build/lib/getDictionaryFilepath.d.ts +3 -0
  24. package/dictionaries/build/lib/getDictionaryFilepath.js +11 -0
  25. package/dictionaries/build/lib/index.d.ts +7 -0
  26. package/dictionaries/build/lib/index.js +20 -0
  27. package/dictionaries/build/types/Cache.d.ts +8 -0
  28. package/dictionaries/build/types/Cache.js +2 -0
  29. package/dictionaries/build/types/index.d.ts +1 -0
  30. package/dictionaries/build/types/index.js +2 -0
  31. package/dictionaries/node_modules/.package-lock.json +16 -0
  32. package/dictionaries/node_modules/@kamilmielnik/trie/LICENSE +21 -0
  33. package/dictionaries/node_modules/@kamilmielnik/trie/README.md +187 -0
  34. package/dictionaries/node_modules/@kamilmielnik/trie/dist/Trie.d.ts +99 -0
  35. package/dictionaries/node_modules/@kamilmielnik/trie/dist/Trie.js +118 -0
  36. package/dictionaries/node_modules/@kamilmielnik/trie/dist/constants.d.ts +8 -0
  37. package/dictionaries/node_modules/@kamilmielnik/trie/dist/constants.js +11 -0
  38. package/dictionaries/node_modules/@kamilmielnik/trie/dist/index.d.ts +5 -0
  39. package/dictionaries/node_modules/@kamilmielnik/trie/dist/index.js +24 -0
  40. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/add.d.ts +10 -0
  41. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/add.js +22 -0
  42. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/deserialize.d.ts +11 -0
  43. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/deserialize.js +49 -0
  44. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/find.d.ts +10 -0
  45. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/find.js +21 -0
  46. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/fromArray.d.ts +9 -0
  47. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/fromArray.js +18 -0
  48. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/has.d.ts +10 -0
  49. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/has.js +18 -0
  50. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/hasPrefix.d.ts +12 -0
  51. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/hasPrefix.js +20 -0
  52. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/index.d.ts +11 -0
  53. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/index.js +28 -0
  54. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/nodeKeyComparator.d.ts +10 -0
  55. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/nodeKeyComparator.js +20 -0
  56. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/remove.d.ts +10 -0
  57. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/remove.js +32 -0
  58. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/serialize.d.ts +17 -0
  59. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/serialize.js +34 -0
  60. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/toArray.d.ts +10 -0
  61. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/toArray.js +22 -0
  62. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/traverse.d.ts +10 -0
  63. package/dictionaries/node_modules/@kamilmielnik/trie/dist/lib/traverse.js +53 -0
  64. package/dictionaries/node_modules/@kamilmielnik/trie/dist/types.d.ts +30 -0
  65. package/dictionaries/node_modules/@kamilmielnik/trie/dist/types.js +2 -0
  66. package/dictionaries/node_modules/@kamilmielnik/trie/package.json +69 -0
  67. package/package.json +4 -4
  68. package/src/locales/index.ts +1 -0
  69. package/src/locales/roRo.ts +39 -0
@@ -0,0 +1,20 @@
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 find_1 = __importDefault(require("./find"));
7
+ /**
8
+ * Tells you whether there are any words with given prefix in the {@link Node}.
9
+ *
10
+ * See: https://en.wikipedia.org/wiki/String_operations#Prefixes
11
+ *
12
+ * @param node - {@link Node} to look for prefix in.
13
+ * @param prefix - Prefix to be found.
14
+ * @returns true if there are any words with given prefix in the {@link Node}, false otherwise.
15
+ */
16
+ const hasPrefix = (node, prefix) => {
17
+ const foundNode = (0, find_1.default)(node, prefix);
18
+ return foundNode ? Object.keys(foundNode).length > 0 : false;
19
+ };
20
+ exports.default = hasPrefix;
@@ -0,0 +1,11 @@
1
+ export { default as add } from './add';
2
+ export { default as deserialize } from './deserialize';
3
+ export { default as has } from './has';
4
+ export { default as hasPrefix } from './hasPrefix';
5
+ export { default as find } from './find';
6
+ export { default as fromArray } from './fromArray';
7
+ export { default as nodeKeyComparator } from './nodeKeyComparator';
8
+ export { default as remove } from './remove';
9
+ export { default as serialize } from './serialize';
10
+ export { default as toArray } from './toArray';
11
+ export { default as traverse } from './traverse';
@@ -0,0 +1,28 @@
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
+ exports.traverse = exports.toArray = exports.serialize = exports.remove = exports.nodeKeyComparator = exports.fromArray = exports.find = exports.hasPrefix = exports.has = exports.deserialize = exports.add = void 0;
7
+ var add_1 = require("./add");
8
+ Object.defineProperty(exports, "add", { enumerable: true, get: function () { return __importDefault(add_1).default; } });
9
+ var deserialize_1 = require("./deserialize");
10
+ Object.defineProperty(exports, "deserialize", { enumerable: true, get: function () { return __importDefault(deserialize_1).default; } });
11
+ var has_1 = require("./has");
12
+ Object.defineProperty(exports, "has", { enumerable: true, get: function () { return __importDefault(has_1).default; } });
13
+ var hasPrefix_1 = require("./hasPrefix");
14
+ Object.defineProperty(exports, "hasPrefix", { enumerable: true, get: function () { return __importDefault(hasPrefix_1).default; } });
15
+ var find_1 = require("./find");
16
+ Object.defineProperty(exports, "find", { enumerable: true, get: function () { return __importDefault(find_1).default; } });
17
+ var fromArray_1 = require("./fromArray");
18
+ Object.defineProperty(exports, "fromArray", { enumerable: true, get: function () { return __importDefault(fromArray_1).default; } });
19
+ var nodeKeyComparator_1 = require("./nodeKeyComparator");
20
+ Object.defineProperty(exports, "nodeKeyComparator", { enumerable: true, get: function () { return __importDefault(nodeKeyComparator_1).default; } });
21
+ var remove_1 = require("./remove");
22
+ Object.defineProperty(exports, "remove", { enumerable: true, get: function () { return __importDefault(remove_1).default; } });
23
+ var serialize_1 = require("./serialize");
24
+ Object.defineProperty(exports, "serialize", { enumerable: true, get: function () { return __importDefault(serialize_1).default; } });
25
+ var toArray_1 = require("./toArray");
26
+ Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return __importDefault(toArray_1).default; } });
27
+ var traverse_1 = require("./traverse");
28
+ Object.defineProperty(exports, "traverse", { enumerable: true, get: function () { return __importDefault(traverse_1).default; } });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Comparator that allows sorting {@link Node} keys alphabetically
3
+ * with the exception of "wordEnd" which should always come first.
4
+ *
5
+ * @param key1 - First key to compare.
6
+ * @param key2 - Second key to compare.
7
+ * @returns -1 if key1 should precede key2, 0 if they're the same, 1 if key2 should precede key1.
8
+ */
9
+ declare const nodeKeyComparator: (key1: string, key2: string) => number;
10
+ export default nodeKeyComparator;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Comparator that allows sorting {@link Node} keys alphabetically
5
+ * with the exception of "wordEnd" which should always come first.
6
+ *
7
+ * @param key1 - First key to compare.
8
+ * @param key2 - Second key to compare.
9
+ * @returns -1 if key1 should precede key2, 0 if they're the same, 1 if key2 should precede key1.
10
+ */
11
+ const nodeKeyComparator = (key1, key2) => {
12
+ if (key1 === 'wordEnd') {
13
+ return -1;
14
+ }
15
+ if (key2 === 'wordEnd') {
16
+ return 1;
17
+ }
18
+ return key1.localeCompare(key2);
19
+ };
20
+ exports.default = nodeKeyComparator;
@@ -0,0 +1,10 @@
1
+ import type { Node } from '../types';
2
+ /**
3
+ * Removes given word from given {@link Node} if it exists.
4
+ *
5
+ * @param node - {@link Node} to remove word from.
6
+ * @param word - Word to be removed.
7
+ * @returns true if the word was removed, false otherwise.
8
+ */
9
+ declare const remove: (node: Node, word: string) => boolean;
10
+ export default remove;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Removes given word from given {@link Node} if it exists.
5
+ *
6
+ * @param node - {@link Node} to remove word from.
7
+ * @param word - Word to be removed.
8
+ * @returns true if the word was removed, false otherwise.
9
+ */
10
+ const remove = (node, word) => {
11
+ if (word.length === 0) {
12
+ if (node.wordEnd) {
13
+ delete node.wordEnd;
14
+ return true;
15
+ }
16
+ return false;
17
+ }
18
+ const letter = word[0];
19
+ const nextNode = node[letter];
20
+ if (!nextNode) {
21
+ return false;
22
+ }
23
+ const removed = remove(nextNode, word.substring(1));
24
+ if (!removed) {
25
+ return false;
26
+ }
27
+ if (Object.keys(nextNode).length === 0) {
28
+ delete node[letter];
29
+ }
30
+ return true;
31
+ };
32
+ exports.default = remove;
@@ -0,0 +1,17 @@
1
+ import type { Node } from '../types';
2
+ /**
3
+ * Converts given {@link Node} into a string.
4
+ *
5
+ * The inverse of {@link deserialize}.
6
+ *
7
+ * It serializes {@link https://sjp.pl/slownik/growy/ | 42.8 MB Polish dictionary} down to 18.7 MB (-56%).
8
+ *
9
+ * It serializes {@link https://www.wordgamedictionary.com/twl06/download/twl06.txt | 1.9 MB English (US) dictionary} down to 1.4 MB (-30%).
10
+ *
11
+ * It serializes {@link https://www.wordgamedictionary.com/sowpods/download/sowpods.txt | 3 MB English (GB) dictionary} down to 2 MB (-32%).
12
+ *
13
+ * @param node - {@link Node} to serialize.
14
+ * @returns String with serialized data.
15
+ */
16
+ declare const serialize: (node: Node) => string;
17
+ export default serialize;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constants_1 = require("../constants");
4
+ const serializeNode = (node, character) => {
5
+ const letters = Object.keys(node).filter((key) => key.length === 1);
6
+ const hasPrefix = letters.length > 0;
7
+ let serialized = '';
8
+ if (node.wordEnd) {
9
+ serialized += character;
10
+ }
11
+ if (hasPrefix) {
12
+ serialized += character;
13
+ serialized += constants_1.OPEN_PARENS;
14
+ serialized += letters.map((letter) => serializeNode(node[letter], letter)).join('');
15
+ serialized += constants_1.CLOSE_PARENS;
16
+ }
17
+ return serialized;
18
+ };
19
+ /**
20
+ * Converts given {@link Node} into a string.
21
+ *
22
+ * The inverse of {@link deserialize}.
23
+ *
24
+ * It serializes {@link https://sjp.pl/slownik/growy/ | 42.8 MB Polish dictionary} down to 18.7 MB (-56%).
25
+ *
26
+ * It serializes {@link https://www.wordgamedictionary.com/twl06/download/twl06.txt | 1.9 MB English (US) dictionary} down to 1.4 MB (-30%).
27
+ *
28
+ * It serializes {@link https://www.wordgamedictionary.com/sowpods/download/sowpods.txt | 3 MB English (GB) dictionary} down to 2 MB (-32%).
29
+ *
30
+ * @param node - {@link Node} to serialize.
31
+ * @returns String with serialized data.
32
+ */
33
+ const serialize = (node) => serializeNode(node, '');
34
+ exports.default = serialize;
@@ -0,0 +1,10 @@
1
+ import type { Descendant, Node, TraverseOptions } from '../types';
2
+ /**
3
+ * Finds all {@link Descendant | descendants} of given {@link Node} and returns them as an array.
4
+ *
5
+ * @param node - {@link Node} to look for {@link Descendant | descendants} in.
6
+ * @param options - See {@link TraverseOptions}.
7
+ * @returns An array of {@link Descendant | descendants}.
8
+ */
9
+ declare const toArray: (node: Node, options?: TraverseOptions) => Descendant[];
10
+ export default toArray;
@@ -0,0 +1,22 @@
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 traverse_1 = __importDefault(require("./traverse"));
7
+ /**
8
+ * Finds all {@link Descendant | descendants} of given {@link Node} and returns them as an array.
9
+ *
10
+ * @param node - {@link Node} to look for {@link Descendant | descendants} in.
11
+ * @param options - See {@link TraverseOptions}.
12
+ * @returns An array of {@link Descendant | descendants}.
13
+ */
14
+ const toArray = (node, options) => {
15
+ const descendants = [];
16
+ const callback = (parameters) => {
17
+ descendants.push(parameters);
18
+ };
19
+ (0, traverse_1.default)(node, callback, options);
20
+ return descendants;
21
+ };
22
+ exports.default = toArray;
@@ -0,0 +1,10 @@
1
+ import type { Node, TraverseCallback, TraverseOptions } from '../types';
2
+ /**
3
+ * Visits every descendant {@link Node} of given {@link Node} and calls a callback.
4
+ *
5
+ * @param node - {@link Node} to look for descendant {@link Node | Nodes} in.
6
+ * @param callback - Callback that will be called for each visited {@link Node}. Return true from callback to stop traversing.
7
+ * @param options - See {@link TraverseOptions}.
8
+ */
9
+ declare const traverse: (node: Node, callback: TraverseCallback, options?: TraverseOptions) => void;
10
+ export default traverse;
@@ -0,0 +1,53 @@
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 nodeKeyComparator_1 = __importDefault(require("./nodeKeyComparator"));
7
+ /**
8
+ * Visits every descendant {@link Node} of given {@link Node} and calls a callback.
9
+ *
10
+ * @param node - {@link Node} to look for descendant {@link Node | Nodes} in.
11
+ * @param callback - Callback that will be called for each visited {@link Node}. Return true from callback to stop traversing.
12
+ * @param options - See {@link TraverseOptions}.
13
+ */
14
+ const traverse = (node, callback, options = {}) => {
15
+ const stack = [];
16
+ let currentKeyIndex = 0;
17
+ let currentNode = node;
18
+ let currentPrefix = options.prefix || '';
19
+ while (stack.length > 0 || currentNode) {
20
+ while (currentNode) {
21
+ const keys = Object.keys(currentNode);
22
+ if (currentKeyIndex >= keys.length) {
23
+ currentNode = undefined;
24
+ }
25
+ else {
26
+ const sortedKeys = options.sort ? keys.sort(nodeKeyComparator_1.default) : keys;
27
+ const key = sortedKeys[currentKeyIndex];
28
+ if (key === 'wordEnd') {
29
+ ++currentKeyIndex;
30
+ }
31
+ else {
32
+ stack.push({ keyIndex: currentKeyIndex, node: currentNode });
33
+ currentKeyIndex = 0;
34
+ currentNode = currentNode[key];
35
+ currentPrefix += key;
36
+ if (!options.wordsOnly || currentNode.wordEnd) {
37
+ const shouldStop = callback({ node: currentNode, prefix: currentPrefix });
38
+ if (shouldStop) {
39
+ return;
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ if (stack.length > 0) {
46
+ const state = stack.pop();
47
+ currentKeyIndex = state.keyIndex + 1;
48
+ currentNode = state.node;
49
+ currentPrefix = currentPrefix.slice(0, -1);
50
+ }
51
+ }
52
+ };
53
+ exports.default = traverse;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Keys are single characters (strings of length 1) or "wordEnd".
3
+ * "wordEnd: true" indicates that keys of all parent {@link Node | Nodes} make a valid word when joined together.
4
+ */
5
+ export interface Node extends Record<string, Node | true | undefined> {
6
+ wordEnd?: true;
7
+ }
8
+ export declare type TraverseCallback = (descendant: Descendant) => boolean | void;
9
+ export declare type Descendant = {
10
+ node: Node;
11
+ prefix: string;
12
+ };
13
+ export declare type TraverseOptions = {
14
+ /**
15
+ * Set the prefix to be applied to all descendants.
16
+ * It should be the prefix represented by the {@link Node} at which traversing starts.
17
+ * Defaults to empty string.
18
+ */
19
+ prefix?: string;
20
+ /**
21
+ * Set to true to visit {@link Node | Nodes} in alphabetical order.
22
+ * Defaults to false.
23
+ */
24
+ sort?: boolean;
25
+ /**
26
+ * Set to true to only visit {@link Node | Nodes} representing complete words.
27
+ * Defaults to false.
28
+ */
29
+ wordsOnly?: boolean;
30
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@kamilmielnik/trie",
3
+ "version": "2.0.1",
4
+ "description": "Trie data structure implementation in TypeScript. Highly performant. No dependencies. Built for a Scrabble Solver.",
5
+ "keywords": [
6
+ "trie",
7
+ "data",
8
+ "structure",
9
+ "algorithm",
10
+ "scrabble",
11
+ "solver",
12
+ "typescript",
13
+ "prefix",
14
+ "tree"
15
+ ],
16
+ "engines": {
17
+ "node": ">=16"
18
+ },
19
+ "main": "./dist/index.js",
20
+ "license": "MIT",
21
+ "author": {
22
+ "name": "Kamil Mielnik",
23
+ "email": "kamil.adam.mielnik@gmail.com",
24
+ "url": "https://kamilmielnik.com/"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/kamilmielnik/trie.git"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/kamilmielnik/trie/issues"
32
+ },
33
+ "homepage": "https://github.com/kamilmielnik/trie#readme",
34
+ "files": [
35
+ "dist/**"
36
+ ],
37
+ "types": "./dist/index.d.ts",
38
+ "np": {
39
+ "yarn": false
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "scripts": {
45
+ "clean": "rimraf coverage dist docs",
46
+ "build": "tsc --project .",
47
+ "build:docs": "typedoc",
48
+ "postbuild": "npm run build:docs",
49
+ "prettier": "prettier --list-different './src/**/*.{js,ts}'",
50
+ "prettier:fix": "npm run prettier:js -- --write --no-list-different",
51
+ "prebuild": "npm run clean",
52
+ "prerelease": "npm run test && npm run build && npm run build:docs",
53
+ "release": "np",
54
+ "test": "jest",
55
+ "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
56
+ "test:watch": "jest --watch"
57
+ },
58
+ "devDependencies": {
59
+ "@types/jest": "^29.1.2",
60
+ "jest": "^29.1.2",
61
+ "np": "^7.6.2",
62
+ "prettier": "^2.7.1",
63
+ "rimraf": "^3.0.2",
64
+ "ts-jest": "^29.0.3",
65
+ "typedoc": "^0.23.15",
66
+ "typedoc-plugin-markdown": "^3.13.6",
67
+ "typescript": "^4.8.4"
68
+ }
69
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/configs",
3
- "version": "2.12.5",
3
+ "version": "2.13.1",
4
4
  "description": "Scrabble Solver 2 - Configs",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  "clean:force": "npm run clean && rimraf package-lock.json"
25
25
  },
26
26
  "dependencies": {
27
- "@scrabble-solver/constants": "^2.12.5",
28
- "@scrabble-solver/types": "^2.12.5"
27
+ "@scrabble-solver/constants": "^2.13.1",
28
+ "@scrabble-solver/types": "^2.13.1"
29
29
  },
30
- "gitHead": "ff33bcbceeb7010bade54d6a370efe3c574fe183"
30
+ "gitHead": "0588fd5c88be44c2f3e96d8cf8cc6fa7166c924c"
31
31
  }
@@ -5,3 +5,4 @@ export { default as esEs } from './esEs';
5
5
  export { default as faIr } from './faIr';
6
6
  export { default as frFr } from './frFr';
7
7
  export { default as plPl } from './plPl';
8
+ export { default as roRo } from './roRo';
@@ -0,0 +1,39 @@
1
+ import { Config, Locale } from '@scrabble-solver/types';
2
+
3
+ import { scrabble } from '../games';
4
+
5
+ const roRo: Config[] = [
6
+ new Config({
7
+ ...scrabble,
8
+ locale: Locale.RO_RO,
9
+ /**
10
+ * @see https://frsc1.fortunecity.ws/reg6scr.htm#vallit
11
+ */
12
+ tiles: [
13
+ { character: 'a', count: 11, score: 1 },
14
+ { character: 'b', count: 2, score: 9 },
15
+ { character: 'c', count: 5, score: 1 },
16
+ { character: 'd', count: 4, score: 2 },
17
+ { character: 'e', count: 9, score: 1 },
18
+ { character: 'f', count: 2, score: 8 },
19
+ { character: 'g', count: 2, score: 9 },
20
+ { character: 'h', count: 1, score: 10 },
21
+ { character: 'i', count: 10, score: 1 },
22
+ { character: 'j', count: 1, score: 10 },
23
+ { character: 'l', count: 4, score: 1 },
24
+ { character: 'm', count: 3, score: 4 },
25
+ { character: 'n', count: 6, score: 1 },
26
+ { character: 'o', count: 5, score: 1 },
27
+ { character: 'p', count: 4, score: 2 },
28
+ { character: 'r', count: 7, score: 1 },
29
+ { character: 's', count: 5, score: 1 },
30
+ { character: 't', count: 7, score: 1 },
31
+ { character: 'u', count: 6, score: 1 },
32
+ { character: 'v', count: 2, score: 8 },
33
+ { character: 'x', count: 1, score: 10 },
34
+ { character: 'z', count: 1, score: 10 },
35
+ ],
36
+ }),
37
+ ];
38
+
39
+ export default roRo;