protected virtual void Write(string localName, Morpheme morpheme) { m_xmlWriter.WriteStartElement(localName); m_xmlWriter.WriteAttributeString("id", morpheme.ID); m_xmlWriter.WriteElementString("Description", morpheme.Description); if (morpheme.Gloss != null) { m_xmlWriter.WriteElementString("Gloss", morpheme.Gloss.Description); } m_xmlWriter.WriteEndElement(); }
public int CompareTo(Allomorph other) { if (other == null) { return(1); } int res = Morpheme.GetHashCode().CompareTo(other.Morpheme.GetHashCode()); if (res != 0) { return(res); } return(Index.CompareTo(other.Index)); }
private XElement CreateMorphemeElement(Morpheme morpheme) { var msaID = (int?) morpheme.Properties["ID"] ?? 0; IMoMorphSynAnalysis msa; if (msaID == 0 || !m_cache.ServiceLocator.GetInstance<IMoMorphSynAnalysisRepository>().TryGetObject(msaID, out msa)) return null; return HCParser.CreateMorphemeElement(msa); }
protected virtual void Write(string localName, Morpheme morpheme) { m_xmlWriter.WriteStartElement(localName); m_xmlWriter.WriteAttributeString("id", morpheme.ID); m_xmlWriter.WriteElementString("Description", morpheme.Description); if (morpheme.Gloss != null) m_xmlWriter.WriteElementString("Gloss", morpheme.Gloss.Description); m_xmlWriter.WriteEndElement(); }
protected virtual XElement Write(string name, Morpheme morpheme) { XElement elem = Write(name, (HCObject) morpheme); if (morpheme.Gloss != null) elem.Add(new XElement("Gloss", morpheme.Gloss.Description)); return elem; }