From acc013a1a8051d34322f0f5f91d7bdecc0a18843 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 28 Jan 2024 07:22:47 -0500 Subject: JapaneseUtil refactor (#555) * Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions --- test/fixtures/translator-test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test/fixtures') diff --git a/test/fixtures/translator-test.js b/test/fixtures/translator-test.js index f162972d..6562931c 100644 --- a/test/fixtures/translator-test.js +++ b/test/fixtures/translator-test.js @@ -26,7 +26,6 @@ import {createDictionaryArchive} from '../../dev/util.js'; import {AnkiNoteDataCreator} from '../../ext/js/data/sandbox/anki-note-data-creator.js'; import {DictionaryDatabase} from '../../ext/js/dictionary/dictionary-database.js'; import {DictionaryImporter} from '../../ext/js/dictionary/dictionary-importer.js'; -import {JapaneseUtil} from '../../ext/js/language/sandbox/japanese-util.js'; import {Translator} from '../../ext/js/language/translator.js'; import {chrome, fetch} from '../mocks/common.js'; import {DictionaryImporterMediaLoader} from '../mocks/dictionary-importer-media-loader.js'; @@ -65,14 +64,13 @@ async function createTranslatorContext(dictionaryDirectory, dictionaryName) { expect(errors.length).toEqual(0); // Setup translator - const japaneseUtil = new JapaneseUtil(null); - const translator = new Translator({japaneseUtil, database: dictionaryDatabase}); + const translator = new Translator({database: dictionaryDatabase}); /** @type {import('deinflector').ReasonsRaw} */ const deinflectionReasons = parseJson(readFileSync(deinflectionReasonsPath, {encoding: 'utf8'})); translator.prepare(deinflectionReasons); // Assign properties - const ankiNoteDataCreator = new AnkiNoteDataCreator(japaneseUtil); + const ankiNoteDataCreator = new AnkiNoteDataCreator(); return {translator, ankiNoteDataCreator}; } -- cgit v1.2.3