public XDocument TraceWordXml(string word, IEnumerable<int> selectTraceMorphs) { CheckDisposed(); var sb = new StringBuilder(m_xample.TraceWord(word, selectTraceMorphs == null ? null : string.Join(" ", selectTraceMorphs))); sb.Remove(0, 47); sb.Replace("]", "]"); while (sb[sb.Length - 1] == '\x0') sb.Remove(sb.Length - 1, 1); XDocument doc = XDocument.Parse(sb.ToString()); using (new WorkerThreadReadHelper(m_cache.ServiceLocator.GetInstance<IWorkerThreadReadHandler>())) { foreach (XElement morphElem in doc.Descendants("morph")) { var formID = (string) morphElem.Attribute("alloid"); var msaID = (string) morphElem.Attribute("morphname"); var type = (string) morphElem.Attribute("type"); var props = (string) morphElem.Element("props"); var wordType = (string) morphElem.Attribute("wordType"); using (XmlWriter writer = morphElem.CreateWriter()) { writer.WriteMorphInfoElements(m_cache, formID, msaID, wordType, props); writer.WriteMsaElement(m_cache, formID, msaID, type, wordType); writer.WriteInflClassesElement(m_cache, formID); } } ConvertFailures(doc, GetStrRep); } return doc; }
protected override string TraceWord(string form, string selectTraceMorphs) { return(m_xample.TraceWord(form, selectTraceMorphs)); }