summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-14 21:25:02 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-14 21:25:02 +0300
commit619df42aedaa8da97d0a16d539b7211349143a0a (patch)
tree32f4977ba09a5deb6769eec9d913aff85d6b4847 /ext/bg
parent3fa8b8e1866933fdfccd0598a11e443fc1693840 (diff)
simplify to enable constant usage
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/backend.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 960c65bf..f8b0fc96 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -349,11 +349,10 @@ class Backend {
for (const [mecabName, parsedLines] of Object.entries(rawResults)) {
const result = [];
for (const parsedLine of parsedLines) {
- for (let {expression, reading, source} of parsedLine) {
+ for (const {expression, reading, source} of parsedLine) {
const term = [];
- if (expression === '') { expression = source; }
for (const {text: text2, furigana} of jp.distributeFuriganaInflected(
- expression,
+ expression.length > 0 ? expression : source,
jp.convertKatakanaToHiragana(reading),
source
)) {