aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/data/options-schema.json5
-rw-r--r--ext/bg/js/search-query-parser.js5
-rw-r--r--ext/bg/js/settings/main.js1
-rw-r--r--ext/bg/settings.html4
4 files changed, 15 insertions, 0 deletions
diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json
index 224b93f8..d4bd3c21 100644
--- a/ext/bg/data/options-schema.json
+++ b/ext/bg/data/options-schema.json
@@ -381,6 +381,7 @@
"enableScanningParser",
"enableMecabParser",
"selectedParser",
+ "termSpacing",
"readingMode"
],
"properties": {
@@ -396,6 +397,10 @@
"type": ["string", "null"],
"default": null
},
+ "termSpacing": {
+ "type": "boolean",
+ "default": true
+ },
"readingMode": {
"type": "string",
"enum": ["hiragana", "katakana", "romaji", "none"],
diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js
index 8115dd46..e8e6d11f 100644
--- a/ext/bg/js/search-query-parser.js
+++ b/ext/bg/js/search-query-parser.js
@@ -88,6 +88,11 @@ class QueryParser extends TextScanner {
];
}
+ setOptions(options) {
+ super.setOptions(options);
+ this.queryParser.dataset.termSpacing = `${options.parsing.termSpacing}`;
+ }
+
refreshSelectedParser() {
if (this.parseResults.length > 0) {
if (this.selectedParser === null) {
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js
index ac255978..bed57f7d 100644
--- a/ext/bg/js/settings/main.js
+++ b/ext/bg/js/settings/main.js
@@ -74,6 +74,7 @@ async function formRead(options) {
options.parsing.enableScanningParser = $('#parsing-scan-enable').prop('checked');
options.parsing.enableMecabParser = $('#parsing-mecab-enable').prop('checked');
+ options.parsing.termSpacing = $('#parsing-term-spacing').prop('checked');
options.parsing.readingMode = $('#parsing-reading-mode').val();
const optionsAnkiEnableOld = options.anki.enable;
diff --git a/ext/bg/settings.html b/ext/bg/settings.html
index 4b73e02c..f73f79c8 100644
--- a/ext/bg/settings.html
+++ b/ext/bg/settings.html
@@ -451,6 +451,10 @@
<label><input type="checkbox" id="parsing-mecab-enable"> Enable text parsing using MeCab</label>
</div>
+ <div class="checkbox">
+ <label><input type="checkbox" id="parsing-term-spacing"> Enable small spaces between parsed words</label>
+ </div>
+
<div class="form-group">
<label for="parsing-reading-mode">Reading mode</label>
<select class="form-control" id="parsing-reading-mode">