summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mixed/js/japanese.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mixed/js/japanese.js b/ext/mixed/js/japanese.js
index 79d69946..ced486dd 100644
--- a/ext/mixed/js/japanese.js
+++ b/ext/mixed/js/japanese.js
@@ -116,7 +116,11 @@ const jp = (() => {
// Mora functions
function isMoraPitchHigh(moraIndex, pitchAccentPosition) {
- return pitchAccentPosition === 0 ? (moraIndex > 0) : (moraIndex < pitchAccentPosition);
+ switch (pitchAccentPosition) {
+ case 0: return (moraIndex > 0);
+ case 1: return (moraIndex < 1);
+ default: return (moraIndex > 0 && moraIndex < pitchAccentPosition);
+ }
}
function getKanaMorae(text) {