@@ -127,6 +127,7 @@ public class KoreanCVVCPlusPhonemizer : Phonemizer {
127
127
} ;
128
128
129
129
130
+
130
131
static readonly Dictionary < string , string > vowelLookup ;
131
132
static readonly Dictionary < string , string > consonantLookup ;
132
133
@@ -630,28 +631,17 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
630
631
var prevLyric = string . Join ( "" , prevUnicode ) ;
631
632
632
633
// Current note is VV
633
- if ( vowelLookup . TryGetValue ( prevUnicode . LastOrDefault ( ) . ToString ( ) ?? string . Empty , out var vow ) ) {
634
+ if ( vowelLookup . TryGetValue ( prevLyric . ToString ( ) ?? string . Empty , out var vow ) ) {
634
635
vowel = vow ;
635
636
636
637
var mixVV = $ "{ vow } { CV } ";
637
638
638
- if ( prevLyric . EndsWith ( "eo" ) ) {
639
- mixVV = $ "eo { CV } ";
640
- } else if ( prevLyric . EndsWith ( "eu" ) ) {
641
- mixVV = $ "eu { CV } ";
642
- } else if ( prevLyric . EndsWith ( "NG" ) ) {
643
- mixVV = $ "NG { CV } ";
644
- } else if ( prevLyric . EndsWith ( "er" ) ) {
645
- mixVV = $ "er { CV } ";
646
- }
647
-
648
639
// try vowlyric then currentlyric
649
640
string [ ] tests = new string [ ] { mixVV , CV } ;
650
641
if ( checkOtoUntilHit ( tests , note , out var oto ) ) {
651
642
CV = oto . Alias ;
652
643
}
653
644
}
654
-
655
645
}
656
646
657
647
if ( nextNeighbour != null ) { // 다음에 노트가 있으면
@@ -664,7 +654,7 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
664
654
665
655
// Get consonant from next note
666
656
var consonant = "" ;
667
- if ( consonantLookup . TryGetValue ( nextUnicode . FirstOrDefault ( ) . ToString ( ) ?? string . Empty , out var con ) || ( nextLyric . Length >= 3 && consonantLookup . TryGetValue ( nextLyric . Substring ( 0 , 3 ) , out con ) ) ) {
657
+ if ( consonantLookup . TryGetValue ( nextUnicode . FirstOrDefault ( ) . ToString ( ) ?? string . Empty , out var con ) ) {
668
658
consonant = getConsonant ( nextNeighbour ? . lyric ) ; //Mixed romaja
669
659
if ( ( ! isAlphaCon ( consonant ) || con == "f" || con == "v" || con == "z" || con == "th" || con == "rr" ) ) {
670
660
consonant = con ;
@@ -983,21 +973,11 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
983
973
984
974
var prevLyric = string . Join ( "" , prevUnicode ) ;
985
975
// Current note is VV
986
- if ( vowelLookup . TryGetValue ( prevUnicode . LastOrDefault ( ) . ToString ( ) ?? string . Empty , out var vow ) ) {
976
+ if ( vowelLookup . TryGetValue ( prevLyric . ToString ( ) ?? string . Empty , out var vow ) ) {
987
977
vowel = vow ;
988
978
989
979
var vowLyric = $ "{ vow } { currentLyric } ";
990
980
991
- if ( prevLyric . EndsWith ( "eo" ) ) {
992
- vowLyric = $ "eo { currentLyric } ";
993
- } else if ( prevLyric . EndsWith ( "eu" ) ) {
994
- vowLyric = $ "eu { currentLyric } ";
995
- } else if ( prevLyric . EndsWith ( "NG" ) ) {
996
- vowLyric = $ "NG { currentLyric } ";
997
- } else if ( prevLyric . EndsWith ( "er" ) ) {
998
- vowLyric = $ "er { currentLyric } ";
999
- }
1000
-
1001
981
// try vowlyric then currentlyric
1002
982
string [ ] tests = new string [ ] { vowLyric , currentLyric } ;
1003
983
if ( checkOtoUntilHit ( tests , note , out var oto ) ) {
@@ -1064,7 +1044,7 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
1064
1044
1065
1045
// Get consonant from next note
1066
1046
var consonant = "" ;
1067
- if ( consonantLookup . TryGetValue ( nextUnicode . FirstOrDefault ( ) . ToString ( ) ?? string . Empty , out var con ) || ( nextLyric . Length >= 3 && consonantLookup . TryGetValue ( nextLyric . Substring ( 0 , 3 ) , out con ) ) ) {
1047
+ if ( consonantLookup . TryGetValue ( nextUnicode . FirstOrDefault ( ) . ToString ( ) ?? string . Empty , out var con ) ) {
1068
1048
consonant = getConsonant ( nextNeighbour ? . lyric ) ; //Romaja only
1069
1049
if ( ( ! isAlphaCon ( consonant ) || con == "f" || con == "v" || con == "z" || con == "th" || con == "rr" ) ) {
1070
1050
consonant = con ;
@@ -1119,7 +1099,6 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
1119
1099
consonant = "" ;
1120
1100
}
1121
1101
1122
-
1123
1102
if ( consonant == "" ) {
1124
1103
return new Result {
1125
1104
phonemes = new Phoneme [ ] {
0 commit comments