summaryrefslogtreecommitdiff
path: root/ext/mixed/js/japanese.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-23 18:27:11 -0400
committerGitHub <noreply@github.com>2020-04-23 18:27:11 -0400
commita49e4ccc4e5c7defb30bd88535c18137acf9812c (patch)
treef6666de47f49aa5ed961ef30a3f79717d348c45f /ext/mixed/js/japanese.js
parent6b0f1f268b869eed40aa6be9aa43fcfebb9169ed (diff)
parenta761e420846c5a60ad70a5ad0df186c26f97ffd1 (diff)
Merge pull request #472 from toasted-nutbread/fix-pitch-accent-high-calculation
Fix high pitch calculation
Diffstat (limited to 'ext/mixed/js/japanese.js')
-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) {