aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/api.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r--ext/bg/js/api.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 40e9b6d2..bc9dfba1 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -84,7 +84,7 @@ async function apiTextParse(text, optionsContext) {
const translator = utilBackend().translator;
const results = [];
- while (text) {
+ while (text.length > 0) {
const term = [];
const [definitions, sourceLength] = await translator.findTerms(text, {}, options);
if (definitions.length > 0) {
@@ -116,7 +116,7 @@ async function apiTextParseMecab(text, optionsContext) {
for (const parsedLine of rawResults[mecabName]) {
for (const {expression, reading, source} of parsedLine) {
const term = [];
- if (expression && reading) {
+ if (expression !== null && reading !== null) {
for (const {text, furigana} of jpDistributeFuriganaInflected(
expression,
jpKatakanaToHiragana(reading),