From 2577d4054e344d2e6dc08d2cf95e83478c05bee6 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Sat, 23 Nov 2019 18:08:22 +0200 Subject: [PATCH] fix scanning parser --- ext/bg/js/api.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 228447c3..766fb0ed 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -86,7 +86,12 @@ async function apiTextParse(text, optionsContext) { const results = []; while (text.length > 0) { const term = []; - const [definitions, sourceLength] = await translator.findTerms(text, {}, options); + const [definitions, sourceLength] = await translator.findTermsInternal( + text.slice(0, options.scanning.length), + dictEnabledSet(options), + options.scanning.alphanumeric, + {} + ); if (definitions.length > 0) { dictTermsSort(definitions); const {expression, reading} = definitions[0];