summaryrefslogtreecommitdiff
path: root/ext/js/display/display-generator.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-04-26 20:00:03 -0400
committerGitHub <noreply@github.com>2021-04-26 20:00:03 -0400
commit38ed4dc5c71b51f117fe78a3d4b2bbb0171aaec6 (patch)
tree9bb6f1ce062bd20a53e97499cd13a994543deb3e /ext/js/display/display-generator.js
parent83e73800b0ebb9aef4dea676f4ed3751dd0b6e45 (diff)
Improve kifuku detection to not include suru nouns (#1621)
Diffstat (limited to 'ext/js/display/display-generator.js')
-rw-r--r--ext/js/display/display-generator.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index 9a90502e..53a004c1 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -783,17 +783,27 @@ class DisplayGenerator {
}
_isVerbOrAdjective(wordClasses) {
+ let isVerbOrAdjective = false;
+ let isSuruVerb = false;
+ let isNoun = false;
for (const wordClass of wordClasses) {
switch (wordClass) {
case 'v1':
case 'v5':
- case 'vs':
case 'vk':
case 'vz':
case 'adj-i':
- return true;
+ isVerbOrAdjective = true;
+ break;
+ case 'vs':
+ isVerbOrAdjective = true;
+ isSuruVerb = true;
+ break;
+ case 'n':
+ isNoun = true;
+ break;
}
}
- return false;
+ return isVerbOrAdjective && !(isSuruVerb && isNoun);
}
}