public MaryData process(MaryData d) throws Exception { Document doc = d.getDocument(); expand(doc); MaryData result = new MaryData(getOutputType(), d.getLocale()); result.setDocument(doc); return result; }
@Test public void testOneWord() throws SynthesisException, ParserConfigurationException, SAXException, IOException, ParseException, MaryConfigurationException { String lemma = "7"; mary.setOutputType(MaryDataType.WORDS.name()); Document doc = mary.generateXML(lemma); String words = "<maryxml xmlns=\"http://mary.dfki.de/2002/MaryXML\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"0.5\"><p><s><t>" + lemma + "</t></s></p></maryxml>"; Document expectedDoc = DomUtils.parseDocument(words); module.expand(expectedDoc); Diff diff = XMLUnit.compareXML(expectedDoc, doc); // issue where LocalMaryInterface#generateXML and DomUtils#parseDocument dont build the document in same order Assert.assertFalse(diff.identical()); }