From f84bb1080a28feb5994453bbc24a105579d6bf99 Mon Sep 17 00:00:00 2001 From: austinyu12 Date: Sun, 20 Oct 2024 23:08:59 -0700 Subject: [PATCH 1/2] parsing skipped when parsers off --- ext/js/display/query-parser.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/js/display/query-parser.js b/ext/js/display/query-parser.js index 344383fb26..56b3d94f0a 100644 --- a/ext/js/display/query-parser.js +++ b/ext/js/display/query-parser.js @@ -131,12 +131,15 @@ export class QueryParser extends EventDispatcher { */ async setText(text) { this._text = text; - this._setPreview(text); + this._setPreview(text); // this sets the text as the original, queried sentence + if (this._useInternalParser === false && this._useMecabParser === false) { + return; + } /** @type {?import('core').TokenObject} */ const token = {}; this._setTextToken = token; - this._parseResults = await this._api.parseText(text, this._getOptionsContext(), this._scanLength, this._useInternalParser, this._useMecabParser); + this._parseResults = await this._api.parseText(text, this._getOptionsContext(), this._scanLength, this._useInternalParser, this._useMecabParser); // everything below parses the queried sentence and puts spaces between them if (this._setTextToken !== token) { return; } this._refreshSelectedParser(); From e6b3b29c70ba1ac05c9eefbe76bdbd3f1fbaf1ef Mon Sep 17 00:00:00 2001 From: austinyu12 Date: Sun, 20 Oct 2024 23:09:42 -0700 Subject: [PATCH 2/2] removed comments --- ext/js/display/query-parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/js/display/query-parser.js b/ext/js/display/query-parser.js index 56b3d94f0a..cf487a3d35 100644 --- a/ext/js/display/query-parser.js +++ b/ext/js/display/query-parser.js @@ -131,7 +131,7 @@ export class QueryParser extends EventDispatcher { */ async setText(text) { this._text = text; - this._setPreview(text); // this sets the text as the original, queried sentence + this._setPreview(text); if (this._useInternalParser === false && this._useMecabParser === false) { return; @@ -139,7 +139,7 @@ export class QueryParser extends EventDispatcher { /** @type {?import('core').TokenObject} */ const token = {}; this._setTextToken = token; - this._parseResults = await this._api.parseText(text, this._getOptionsContext(), this._scanLength, this._useInternalParser, this._useMecabParser); // everything below parses the queried sentence and puts spaces between them + this._parseResults = await this._api.parseText(text, this._getOptionsContext(), this._scanLength, this._useInternalParser, this._useMecabParser); if (this._setTextToken !== token) { return; } this._refreshSelectedParser();