Fix high pitch calculation
This commit is contained in:
parent
61d2185aee
commit
2f931e5585
@ -116,7 +116,11 @@ const jp = (() => {
|
|||||||
// Mora functions
|
// Mora functions
|
||||||
|
|
||||||
function isMoraPitchHigh(moraIndex, pitchAccentPosition) {
|
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) {
|
function getKanaMorae(text) {
|
||||||
|
Loading…
Reference in New Issue
Block a user