aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/dictionary-data-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-04-28 21:57:49 -0400
committerGitHub <noreply@github.com>2021-04-28 21:57:49 -0400
commit40b29cb0d3ff90094c44dd4cb7abd087a0fd9598 (patch)
tree0723d8cf5c61ffe091a150b9c9a1d2281f7d72a0 /ext/js/language/dictionary-data-util.js
parent512391346bd4f67b1933b768c64d4dac1b58b44d (diff)
Add pitch categories template helper (#1636)
* Move utility function * Expose dictionary entry as a hidden property for internal use * Add pitchCategories helper
Diffstat (limited to 'ext/js/language/dictionary-data-util.js')
-rw-r--r--ext/js/language/dictionary-data-util.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/js/language/dictionary-data-util.js b/ext/js/language/dictionary-data-util.js
index 0a3be234..81d1c290 100644
--- a/ext/js/language/dictionary-data-util.js
+++ b/ext/js/language/dictionary-data-util.js
@@ -188,6 +188,31 @@ class DictionaryDataUtil {
return disambiguations;
}
+ static isNonNounVerbOrAdjective(wordClasses) {
+ let isVerbOrAdjective = false;
+ let isSuruVerb = false;
+ let isNoun = false;
+ for (const wordClass of wordClasses) {
+ switch (wordClass) {
+ case 'v1':
+ case 'v5':
+ case 'vk':
+ case 'vz':
+ case 'adj-i':
+ isVerbOrAdjective = true;
+ break;
+ case 'vs':
+ isVerbOrAdjective = true;
+ isSuruVerb = true;
+ break;
+ case 'n':
+ isNoun = true;
+ break;
+ }
+ }
+ return isVerbOrAdjective && !(isSuruVerb && isNoun);
+ }
+
// Private
static _createFrequencyGroupsFromMap(map) {