Skip to content

Commit 5a4ef92

Browse files
authored
fixes to vcc fallback to vc
1 parent d2efab9 commit 5a4ef92

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

ARPAsingPlusPhonemizer/ArpasingPlusPhonemizer.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel.Design;
34
using System.IO;
45
using System.Linq;
56
using System.Reflection.Metadata;
67
using System.Text;
8+
using NAudio.Flac.Metadata;
79
using OpenUtau.Api;
810
using OpenUtau.Core.G2p;
911
using Serilog;
@@ -361,7 +363,7 @@ protected override List<string> ProcessSyllable(Syllable syllable) {
361363
var vcc = $"{prevV} {string.Join("", cc.Take(2))}";
362364
var vc = $"{prevV} {cc[0]}";
363365
// CCV will trigger VCC
364-
bool CCV = false;
366+
bool CCV = false;
365367
if (syllable.CurrentWordCc.Length >= 2 && !ccvException.Contains(cc[0])) {
366368
if (HasOto($"{string.Join("", cc)} {v}", syllable.vowelTone) || HasOto(ValidateAlias($"{string.Join("", cc)} {v}"), syllable.vowelTone)) {
367369
CCV = true;
@@ -371,21 +373,14 @@ protected override List<string> ProcessSyllable(Syllable syllable) {
371373
phonemes.Add(vr);
372374
phonemes.Add($"- {cc[0]}");
373375
break;
374-
} else if (CCV) {
375-
if (!(ccvException.Contains(cc[0]) && (HasOto(vcc, syllable.tone) || HasOto(ValidateAlias(vcc), syllable.tone)))) {
376-
phonemes.Add(vcc);
377-
firstC = 1;
378-
break;
379-
}
380-
//} else if (vc_cAcception.Contains(cc[0]) && syllable.PreviousWordCc.Length >= 2 && HasOto(vc_c, syllable.tone) && !HasOto($"{prevV}{string.Join(" ", cc.Take(1))}", syllable.tone) || HasOto(ValidateAlias(vc_c), syllable.tone)) {
381-
// phonemes.Add(vc_c);
382-
// firstC = 1;
376+
} else if ((HasOto(vcc, syllable.tone) || HasOto(ValidateAlias(vcc), syllable.tone)) && CCV && !affricates.Contains(string.Join("", cc.Take(2)))) {
377+
phonemes.Add(vcc);
378+
firstC = 1;
383379
break;
384380
} else if (HasOto(vc, syllable.tone) || HasOto(ValidateAlias(vc), syllable.tone)) {
385381
phonemes.Add(vc);
386382
break;
387383
} else {
388-
// If none of the conditions are met, continue the loop
389384
continue;
390385
}
391386
}

0 commit comments

Comments
 (0)