From 0792954e345925b3e3b2ebb733367e138375978e Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Tue, 27 Feb 2024 13:16:21 +0100 Subject: make deinflections language-specific (#720) * abstract deinflections * undo redundant changes * remove cast * MultiLanguageTransformer * comments * comments --- test/fixtures/translator-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/fixtures') diff --git a/test/fixtures/translator-test.js b/test/fixtures/translator-test.js index ff3782a7..6b6eaad8 100644 --- a/test/fixtures/translator-test.js +++ b/test/fixtures/translator-test.js @@ -31,7 +31,7 @@ import {DictionaryImporterMediaLoader} from '../mocks/dictionary-importer-media- import {createDomTest} from './dom-test.js'; const extDir = join(dirname(fileURLToPath(import.meta.url)), '../../ext'); -const languageTransformDescriptorPath = join(extDir, 'data/language/japanese-transforms.json'); +const languageTransformDescriptorPath = join(extDir, 'js/language/ja/japanese-transforms.json'); vi.stubGlobal('indexedDB', indexedDB); vi.stubGlobal('IDBKeyRange', IDBKeyRange); @@ -65,7 +65,7 @@ export async function createTranslatorContext(dictionaryDirectory, dictionaryNam const translator = new Translator(dictionaryDatabase); /** @type {import('language-transformer').LanguageTransformDescriptor} */ const deinflectionReasons = parseJson(readFileSync(languageTransformDescriptorPath, {encoding: 'utf8'})); - translator.prepare(deinflectionReasons); + translator.prepare([deinflectionReasons]); return translator; } -- cgit v1.2.3