summaryrefslogtreecommitdiff
path: root/ext/bg/js/search-query-parser-generator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2020-04-18 11:05:35 -0700
committerAlex Yatskov <alex@foosoft.net>2020-04-18 11:05:35 -0700
commitf2186c51e4ef219d158735d30a32bbf3e49c4e1a (patch)
tree61de35513b6182e83b626c1571bc2aa97234e3b0 /ext/bg/js/search-query-parser-generator.js
parentb3e79d0e396353de2cbefb945412bfda4bd6ca99 (diff)
parent9e7750125c40d1c4121e8d015957606721bede7c (diff)
Merge branch 'master' into testing
Diffstat (limited to 'ext/bg/js/search-query-parser-generator.js')
-rw-r--r--ext/bg/js/search-query-parser-generator.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/bg/js/search-query-parser-generator.js b/ext/bg/js/search-query-parser-generator.js
index 390841c1..9e7ff8aa 100644
--- a/ext/bg/js/search-query-parser-generator.js
+++ b/ext/bg/js/search-query-parser-generator.js
@@ -36,7 +36,7 @@ class QueryParserGenerator {
const termContainer = this._templateHandler.instantiate(preview ? 'term-preview' : 'term');
for (const segment of term) {
if (!segment.text.trim()) { continue; }
- if (!segment.reading || !segment.reading.trim()) {
+ if (!segment.reading.trim()) {
termContainer.appendChild(this.createSegmentText(segment.text));
} else {
termContainer.appendChild(this.createSegment(segment));
@@ -71,7 +71,17 @@ class QueryParserGenerator {
for (const parseResult of parseResults) {
const optionContainer = this._templateHandler.instantiate('select-option');
optionContainer.value = parseResult.id;
- optionContainer.textContent = parseResult.name;
+ switch (parseResult.source) {
+ case 'scanning-parser':
+ optionContainer.textContent = 'Scanning parser';
+ break;
+ case 'mecab':
+ optionContainer.textContent = `MeCab: ${parseResult.dictionary}`;
+ break;
+ default:
+ optionContainer.textContent = 'Unrecognized dictionary';
+ break;
+ }
optionContainer.defaultSelected = selectedParser === parseResult.id;
selectContainer.appendChild(optionContainer);
}