summaryrefslogtreecommitdiff
path: root/ext/js/language/dictionary-database.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-12-17 16:11:19 -0500
committerGitHub <noreply@github.com>2021-12-17 16:11:19 -0500
commit19ab9df6e4110ef7d5927c95993141a1f8960c53 (patch)
tree31849bf1e1c9622cd1aa3aeb0709ad95ffc744b1 /ext/js/language/dictionary-database.js
parent70fa701c906fa4319e0d62818fe5737e983b49ef (diff)
Replace 'wildcard' parameter with 'matchType' (#2038)
Diffstat (limited to 'ext/js/language/dictionary-database.js')
-rw-r--r--ext/js/language/dictionary-database.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/js/language/dictionary-database.js b/ext/js/language/dictionary-database.js
index 25adb571..c20921b5 100644
--- a/ext/js/language/dictionary-database.js
+++ b/ext/js/language/dictionary-database.js
@@ -196,7 +196,7 @@ class DictionaryDatabase {
}
}
- findTermsBulk(termList, dictionaries, wildcard) {
+ findTermsBulk(termList, dictionaries, matchType) {
const visited = new Set();
const predicate = (row) => {
if (!dictionaries.has(row.dictionary)) { return false; }
@@ -206,17 +206,17 @@ class DictionaryDatabase {
return true;
};
- const indexNames = (wildcard === 'prefix') ? ['expressionReverse', 'readingReverse'] : ['expression', 'reading'];
+ const indexNames = (matchType === 'suffix') ? ['expressionReverse', 'readingReverse'] : ['expression', 'reading'];
let createQuery;
- switch (wildcard) {
- case 'suffix':
+ switch (matchType) {
+ case 'prefix':
createQuery = this._createBoundQuery1;
break;
- case 'prefix':
+ case 'suffix':
createQuery = this._createBoundQuery2;
break;
- default:
+ default: // 'exact'
createQuery = this._createOnlyQuery1;
break;
}