Skip to content

Commit 21c4693

Browse files
IsE333stakira
authored andcommitted
Update TurkishCVVCPhonemizer and clean up code
1 parent bee9b39 commit 21c4693

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

OpenUtau.Plugin.Builtin/TurkishCVVCPhonemizer.cs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
using OpenUtau.Core.Ustx;
66

77
namespace OpenUtau.Plugin.Builtin {
8-
[Phonemizer("Turkish CVVC Phonemizer", "TR CVVC", "IsE & comorybxto", language: "TR")]
8+
[Phonemizer("Turkish CVVC Phonemizer", "TR CVVC", "ise", language: "TR")]
9+
// Contributed by ise with the help of Japanese CVVC phonemizer by TUBS
910
public class TurkishCVVCPhonemizer : Phonemizer {
1011
static readonly string[] glottalStops = new string[] { "?", "q" };
1112
static readonly string[] vowels = new string[] { "a", "e", "ae", "eu", "i", "o", "oe", "u", "ue" };
1213
static readonly string[] sustainedConsonants = new string[] { "Y", "L", "LY", "M", "N", "NG" };
1314
static readonly string[] consonants = "9,b,c,ch,d,f,g,h,j,k,l,m,n,ng,p,r,rr,r',s,sh,t,v,w,y,z,by,dy,gy,hy,ky,ly,my,ny,py,ry,ty,Y,L,LY,M,N,NG,-,?,q".Split(',');
1415

15-
static TurkishCVVCPhonemizer() {
16-
}
17-
1816
// Store singer in field, will try reading presamp.ini later
1917
private USinger singer;
2018
public override void SetSinger(USinger singer) => this.singer = singer;
@@ -93,8 +91,6 @@ private string[] getConsonantEnding(SegmentedLyric current, bool hasNext, Segmen
9391
return new string[] { v_ + current.EndC1 };
9492

9593
if (hasNext) {
96-
//if (sustainedConsonants.Contains(current.EndC1.ToUpper()))
97-
// return new string[] { v_ + current.EndC1.ToUpper() };
9894
if (current.EndC1 != "" && current.EndC1 == next.StartC1)
9995
return new string[] { v_ + getAlternativeConsonant(current.EndC1, current.Vow) };
10096

@@ -122,7 +118,7 @@ private string[] getConsonantEnding(SegmentedLyric current, bool hasNext, Segmen
122118
v_ + current.EndC1 };
123119
}
124120

125-
private string getIfPChTK(string c) {
121+
private string checkPChTK(string c) {
126122
if (c == "p" || c == "ch" || c == "t" || c == "k") {
127123
return "";
128124
}
@@ -217,18 +213,6 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
217213
var note = notes[0];
218214
var currentLyric = note.lyric.Normalize();
219215

220-
/*
221-
if (currentLyric[0] == ',')
222-
basicMode = !basicMode;
223-
if (basicMode) {
224-
return new Result {
225-
phonemes = new Phoneme[] {
226-
new Phoneme() {
227-
phoneme = currentLyric,
228-
}
229-
},
230-
};
231-
}*/
232216
if (currentLyric[0] == '.') {
233217
return new Result {
234218
phonemes = new Phoneme[] {
@@ -255,7 +239,7 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
255239
string noteStart = "", noteEnd = "", noteEndCC = "";
256240

257241
if (phonemesCurrent.EndC2 != "") { // + VCC
258-
noteEndInput = new string[] { phonemesCurrent.Vow + " " + phonemesCurrent.EndC1 + getIfPChTK(phonemesCurrent.EndC1) };
242+
noteEndInput = new string[] { phonemesCurrent.Vow + " " + phonemesCurrent.EndC1 + checkPChTK(phonemesCurrent.EndC1) };
259243
noteEndCC = phonemesCurrent.EndC1 + phonemesCurrent.EndC2 + " -";
260244
}
261245

0 commit comments

Comments
 (0)