Compare commits

...
2 Commits
Author SHA1 Message Date
ThePendulum 3196877c37 1.29.3 2024-06-09 18:07:55 +02:00
ThePendulum ab25066936 Improved dictionary. 2024-06-09 18:07:52 +02:00
7 changed files with 369552 additions and 102260 deletions
Executable → Regular
+87912 -102257
View File
File diff suppressed because one or more lines are too long
+102260
View File
File diff suppressed because one or more lines are too long
+89675
View File
File diff suppressed because it is too large Load Diff
+25
View File
@@ -0,0 +1,25 @@
'use strict';
const fs = require('fs').promises;
const words = require('./words.json');
const dictionary = require('./dictionary_old.json');
async function init() {
const definitions = Object.fromEntries(words.map((word) => {
const normalizedWord = word.normalize('NFD').replace(/\p{Diacritic}/ug, '').toLowerCase().trim();
const definition = dictionary[normalizedWord];
const singular = normalizedWord.replace(/s$/, '');
const singularDefinition = dictionary[singular] ? `Plural of ${singular}: ${dictionary[singular]}` : null;
return [normalizedWord, definition || singularDefinition];
}));
const string = JSON.stringify(definitions, null, 4);
await fs.writeFile('./dictionary.json', string);
console.log(`Wrote ${Object.keys(definitions).length} words to ./dictionary.json`);
}
init();
+89677
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.29.2",
"version": "1.29.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.29.2",
"version": "1.29.3",
"license": "ISC",
"dependencies": {
"better-sqlite3": "^8.3.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.29.2",
"version": "1.29.3",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {