/// <summary> /// Initializes a new instance of the <see cref="MorphCoOccurrenceTrace"/> class. /// </summary> /// <param name="cooccurrence"></param> /// <param name="usage"></param> internal MorphCoOccurrenceTrace(MorphCoOccurrence cooccurrence, string usage) { m_cooccurrence = cooccurrence; m_usage = usage; }
public override void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input) { if (TraceTemplatesSynthesis) { var trace = new MorphCoOccurrenceTrace(cooccurrence, usage); ((Trace)input.CurrentTraceObject).AddChild(trace); } }
public override void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input) { if (TraceTemplatesSynthesis) { ((XElement)input.CurrentTraceObject).Add(Write("MorphCooccurrenceRuleFailed", cooccurrence, usage)); } }
protected virtual XElement Write(string name, MorphCoOccurrence coOccurrence, string usage) { XElement elem = new XElement(name); elem.Add(new XElement("Usage", usage)); elem.Add(new XElement("Type", coOccurrence.Type)); var others = new XElement("Others"); foreach (var item in coOccurrence.Others) { var morpheme = item as Morpheme; if (morpheme != null) { others.Add(Write("Morpheme", morpheme)); continue; } var allomorph = item as Allomorph; if (allomorph != null) { others.Add(Write("Allomorph", allomorph)); } } elem.Add(others); elem.Add(new XElement("Adjacency", coOccurrence.Adjacency)); return elem; }
public abstract void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input);