Skip to content

Commit

Permalink
This should fix Issue marytts-it#14
Browse files Browse the repository at this point in the history
  • Loading branch information
ftesser authored and alize committed Mar 4, 2013
1 parent f3560a2 commit f865401
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions marytts-runtime/src/main/java/marytts/modules/JPhonemiser.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public JPhonemiser(String componentName,
this.removeTrailingOneFromPhones = MaryProperties.getBoolean(removetrailingonefromphonesProperty, true);
}
Syllabifier syllabifier = null;
// how do you know about syllabifierClassProperty? (de = null, other true)
if (syllabifierClassProperty != null) {
String className = MaryProperties.getProperty(
syllabifierClassProperty, null);
Expand All @@ -165,10 +166,16 @@ public JPhonemiser(String componentName,
syllabifier = (Syllabifier) c.newInstance(this.allophoneSet,
this.removeTrailingOneFromPhones);
}
} else {
// className is null for all lang except italian...
}

// if a syllabifier is not set go with the default
if (syllabifier == null)
{
syllabifier = new Syllabifier(this.allophoneSet,
this.removeTrailingOneFromPhones);
}

lts = new TrainedLTS(allophoneSet, ltsStream, this.removeTrailingOneFromPhones, syllabifier);
}

Expand Down Expand Up @@ -250,16 +257,18 @@ public MaryData process(MaryData d)
{
phon = this.phonemise(graph, pos, helper);
}
if (ph.length() == 0) { // first part
// The g2pMethod of the combined beast is
// the g2pMethod of the first constituant.
g2pMethod = helper.toString();
ph.append(phon);
} else { // following parts
ph.append(" - ");
// Reduce primary to secondary stress:
ph.append(phon.replace('\'', ','));
}
//if(phon!=null){
if (ph.length() == 0) { // first part
// The g2pMethod of the combined beast is
// the g2pMethod of the first constituant.
g2pMethod = helper.toString();
ph.append(phon);
} else { // following parts
ph.append(" - ");
// Reduce primary to secondary stress:
ph.append(phon.replace('\'', ','));
}
//}
}

if (ph != null && ph.length() > 0) {
Expand Down

0 comments on commit f865401

Please sign in to comment.