From 7a3495dc62f4aa7827d4826f9a632595989f9b7f Mon Sep 17 00:00:00 2001 From: weishaupt <1+weishaupt@noreply.localhost> Date: Wed, 11 Nov 2026 00:09:52 +0000 Subject: [PATCH] Upload files to "tools" --- tools/fetch-wordnet.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tools/fetch-wordnet.js diff --git a/tools/fetch-wordnet.js b/tools/fetch-wordnet.js new file mode 100644 index 0000000..e1102ed --- /dev/null +++ b/tools/fetch-wordnet.js @@ -0,0 +1,12 @@ +// Copies the WordNet database files the thesaurus needs from the wordnet-db package into ./wordnet. +// Run once after npm install: npm run setup +const fs = require('fs'); +const path = require('path'); +const src = path.join(require.resolve('wordnet-db/package.json'), '..', 'dict'); +const dst = path.join(__dirname, '..', 'wordnet'); +fs.mkdirSync(dst, { recursive: true }); +['data.adj', 'data.adv', 'data.noun', 'data.verb', 'index.adj', 'index.adv', 'index.noun', 'index.verb'].forEach((f) => { + fs.copyFileSync(path.join(src, f), path.join(dst, f)); +}); +fs.copyFileSync(path.join(src, '..', 'LICENSE'), path.join(dst, 'LICENSE')); +console.log('WordNet files copied to ' + dst);