Improve kifuku detection to not include suru nouns (#1621)

This commit is contained in:
toasted-nutbread 2021-04-26 20:00:03 -04:00 committed by GitHub
parent 83e73800b0
commit 38ed4dc5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -783,17 +783,27 @@ class DisplayGenerator {
} }
_isVerbOrAdjective(wordClasses) { _isVerbOrAdjective(wordClasses) {
let isVerbOrAdjective = false;
let isSuruVerb = false;
let isNoun = false;
for (const wordClass of wordClasses) { for (const wordClass of wordClasses) {
switch (wordClass) { switch (wordClass) {
case 'v1': case 'v1':
case 'v5': case 'v5':
case 'vs':
case 'vk': case 'vk':
case 'vz': case 'vz':
case 'adj-i': 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);
} }
} }