public Allophone getAllophone() { if (maryxmlElement != null) { AllophoneSet allophoneSet = null; Element voiceElement = (Element) MaryDomUtils.getAncestor(maryxmlElement, MaryXML.VOICE); if (voiceElement != null) { Voice v = Voice.getVoice(voiceElement); if (v != null) { allophoneSet = v.getAllophoneSet(); } } if (allophoneSet == null) { try { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(maryxmlElement); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } String sampa; if (maryxmlElement.getNodeName().equals(MaryXML.PHONE)) { sampa = maryxmlElement.getAttribute("p"); } else { assert maryxmlElement.getNodeName().equals(MaryXML.BOUNDARY); sampa = "_"; } return allophoneSet.getAllophone(sampa); } return null; }
public Allophone getAllophone() { if (maryxmlElement != null) { AllophoneSet allophoneSet = null; Element voiceElement = (Element) MaryDomUtils.getAncestor(maryxmlElement, MaryXML.VOICE); if (voiceElement != null) { Voice v = Voice.getVoice(voiceElement); if (v != null) { allophoneSet = v.getAllophoneSet(); } } if (allophoneSet == null) { try { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(maryxmlElement); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } String sampa; if (maryxmlElement.getNodeName().equals(MaryXML.PHONE)) { sampa = maryxmlElement.getAttribute("p"); } else { assert maryxmlElement.getNodeName().equals(MaryXML.BOUNDARY); sampa = "_"; } return allophoneSet.getAllophone(sampa); } return null; }
/** * For an element in a MaryXML document, do what you can to determine the appropriate AllophoneSet. First search for the * suitable voice, then if that fails, go by locale. * * @param e * e * @return an allophone set if there is any way of determining it, or null. * @throws MaryConfigurationException * if a suitable allophone set exists in principle, but there were problems loading it. */ public static AllophoneSet determineAllophoneSet(Element e) throws MaryConfigurationException { AllophoneSet allophoneSet = null; Element voice = (Element) MaryDomUtils.getAncestor(e, MaryXML.VOICE); Voice maryVoice = Voice.getVoice(voice); if (maryVoice == null) { // Determine Locale in order to use default voice Locale locale = MaryUtils.string2locale(e.getOwnerDocument().getDocumentElement().getAttribute("xml:lang")); maryVoice = Voice.getDefaultVoice(locale); } if (maryVoice != null) { allophoneSet = maryVoice.getAllophoneSet(); } else { Locale locale = MaryUtils.string2locale(e.getOwnerDocument().getDocumentElement().getAttribute("xml:lang")); allophoneSet = determineAllophoneSet(locale); } return allophoneSet; }
/** * For an element in a MaryXML document, do what you can to determine the appropriate AllophoneSet. First search for the * suitable voice, then if that fails, go by locale. * * @param e * e * @return an allophone set if there is any way of determining it, or null. * @throws MaryConfigurationException * if a suitable allophone set exists in principle, but there were problems loading it. */ public static AllophoneSet determineAllophoneSet(Element e) throws MaryConfigurationException { AllophoneSet allophoneSet = null; Element voice = (Element) MaryDomUtils.getAncestor(e, MaryXML.VOICE); Voice maryVoice = Voice.getVoice(voice); if (maryVoice == null) { // Determine Locale in order to use default voice Locale locale = MaryUtils.string2locale(e.getOwnerDocument().getDocumentElement().getAttribute("xml:lang")); maryVoice = Voice.getDefaultVoice(locale); } if (maryVoice != null) { allophoneSet = maryVoice.getAllophoneSet(); } else { Locale locale = MaryUtils.string2locale(e.getOwnerDocument().getDocumentElement().getAttribute("xml:lang")); allophoneSet = determineAllophoneSet(locale); } return allophoneSet; }
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(element); } catch (MaryConfigurationException e) { throw new SynthesisException("Could not determine AllophoneSet", e);
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(element); } catch (MaryConfigurationException e) { throw new SynthesisException("Could not determine AllophoneSet", e);
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(t);
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(t);
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);
String phone = s.getAttribute("p"); if (allophoneSet == null) { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);
String phone = s.getAttribute("p"); if (allophoneSet == null) { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);
String phone = s.getAttribute("p"); if (allophoneSet == null) { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);
String phone = s.getAttribute("p"); if (allophoneSet == null) { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);
public Allophone getAllophone() { if (maryxmlElement != null) { AllophoneSet allophoneSet = null; Element voiceElement = (Element) MaryDomUtils.getAncestor(maryxmlElement, MaryXML.VOICE); if (voiceElement != null) { Voice v = Voice.getVoice(voiceElement); if (v != null) { allophoneSet = v.getAllophoneSet(); } } if (allophoneSet == null) { try { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(maryxmlElement); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } String sampa; if (maryxmlElement.getNodeName().equals(MaryXML.PHONE)) { sampa = maryxmlElement.getAttribute("p"); } else { assert maryxmlElement.getNodeName().equals(MaryXML.BOUNDARY); sampa = "_"; } return allophoneSet.getAllophone(sampa); } return null; }
/** * For an element in a MaryXML document, do what you can to determine the appropriate AllophoneSet. First search for the * suitable voice, then if that fails, go by locale. * * @param e * e * @return an allophone set if there is any way of determining it, or null. * @throws MaryConfigurationException * if a suitable allophone set exists in principle, but there were problems loading it. */ public static AllophoneSet determineAllophoneSet(Element e) throws MaryConfigurationException { AllophoneSet allophoneSet = null; Element voice = (Element) MaryDomUtils.getAncestor(e, MaryXML.VOICE); Voice maryVoice = Voice.getVoice(voice); if (maryVoice == null) { // Determine Locale in order to use default voice Locale locale = MaryUtils.string2locale(e.getOwnerDocument().getDocumentElement().getAttribute("xml:lang")); maryVoice = Voice.getDefaultVoice(locale); } if (maryVoice != null) { allophoneSet = maryVoice.getAllophoneSet(); } else { Locale locale = MaryUtils.string2locale(e.getOwnerDocument().getDocumentElement().getAttribute("xml:lang")); allophoneSet = determineAllophoneSet(locale); } return allophoneSet; }
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(element); } catch (MaryConfigurationException e) { throw new SynthesisException("Could not determine AllophoneSet", e);
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(t);
allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);
String phone = s.getAttribute("p"); if (allophoneSet == null) { allophoneSet = MaryRuntimeUtils.determineAllophoneSet(s);