diff options
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/api.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 174a439e..dbbe7368 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -85,10 +85,11 @@ async function apiTextParse(text, optionsContext) { const results = []; while (text) { - let [definitions, length] = await translator.findTerms(text, {}, options); + let [definitions, sourceLength] = await translator.findTerms(text, {}, options); if (definitions.length > 0) { definitions = dictTermsSort(definitions); - const {expression, source, reading} = definitions[0]; + const {expression, reading} = definitions[0]; + const source = text.slice(0, sourceLength); let stemLength = 0; const shortest = Math.min(source.length, expression.length); |