aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/search-query-parser-generator.js
diff options
context:
space:
mode:
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);
}