aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/api.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-04 20:09:34 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-10 14:02:43 -0500
commitaf1662acadbfb7a96e06257a9dfad71ed6e2c478 (patch)
tree28e38fe7d35b70d41d4b6dcf766dc1b269ae109c /ext/bg/js/api.js
parentae10bb7096fafc94ffb7227a16e13373c1c1c403 (diff)
Update how apiTermsFind works
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r--ext/bg/js/api.js16
1 files changed, 1 insertions, 15 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 9fed99a1..9751d4a1 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -74,21 +74,7 @@ async function apiOptionsSave(source) {
async function apiTermsFind(text, optionsContext) {
const options = await apiOptionsGet(optionsContext);
- const translator = utilBackend().translator;
-
- const searcher = {
- 'merge': translator.findTermsMerged,
- 'split': translator.findTermsSplit,
- 'group': translator.findTermsGrouped
- }[options.general.resultOutputMode].bind(translator);
-
- const {definitions, length} = await searcher(
- text,
- dictEnabledSet(options),
- options.scanning.alphanumeric,
- options
- );
-
+ const [definitions, length] = await utilBackend().translator.findTerms(text, options);
return {
length,
definitions: definitions.slice(0, options.general.maxResults)