File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -138,11 +138,25 @@ List<phonemesPerNote> ProcessWord(Note[] notes){
138138 } ;
139139 var dsPhonemes = GetDsPhonemes ( notes [ 0 ] ) ;
140140 var isVowel = dsPhonemes . Select ( s => g2p . IsVowel ( s . Symbol ) ) . ToArray ( ) ;
141+ var isGlide = dsPhonemes . Select ( s => g2p . IsGlide ( s . Symbol ) ) . ToArray ( ) ;
141142 var nonExtensionNotes = notes . Where ( n=> ! IsSyllableVowelExtensionNote ( n ) ) . ToArray ( ) ;
143+ var isStart = new bool [ dsPhonemes . Length ] ;
144+ if ( ! isStart . Any ( ) ) {
145+ isStart [ 0 ] = true ;
146+ }
147+ for ( int i = 0 ; i < dsPhonemes . Length ; i ++ ) {
148+ if ( isVowel [ i ] ) {
149+ if ( i >= 2 && isGlide [ i - 1 ] && ! isVowel [ i - 2 ] ) {
150+ isStart [ i - 1 ] = true ;
151+ } else {
152+ isStart [ i ] = true ;
153+ }
154+ }
155+ }
142156 //distribute phonemes to notes
143157 var noteIndex = 0 ;
144158 for ( int i = 0 ; i < dsPhonemes . Length ; i ++ ) {
145- if ( isVowel [ i ] && noteIndex < nonExtensionNotes . Length ) {
159+ if ( isStart [ i ] && noteIndex < nonExtensionNotes . Length ) {
146160 var note = nonExtensionNotes [ noteIndex ] ;
147161 wordPhonemes . Add ( new phonemesPerNote ( note . position , note . tone ) ) ;
148162 noteIndex ++ ;
You can’t perform that action at this time.
0 commit comments