From f865401b62ac9ec311966b200e2ec6a7abb0e578 Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Fri, 26 Oct 2012 17:52:30 +0200 Subject: [PATCH] This should fix Issue marytts-it/marytts#14 --- .../java/marytts/modules/JPhonemiser.java | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/marytts-runtime/src/main/java/marytts/modules/JPhonemiser.java b/marytts-runtime/src/main/java/marytts/modules/JPhonemiser.java index 203c88aa01..25e8f7d73c 100644 --- a/marytts-runtime/src/main/java/marytts/modules/JPhonemiser.java +++ b/marytts-runtime/src/main/java/marytts/modules/JPhonemiser.java @@ -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); @@ -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); } @@ -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) {