aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-22 21:04:18 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-22 21:04:18 -0400
commit2f931e55854daf552f1080ba41b81782000b5e0e (patch)
tree643808be12c7fce73cbaa93c30b4676c2ef04f13 /ext/mixed
parent61d2185aee42848fc84174b2ac707e70a957d58e (diff)
Fix high pitch calculation
Diffstat (limited to 'ext/mixed')
-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) {