Exemplo n.º 1
0
		/// <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;
		}
Exemplo n.º 2
0
		public override void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input)
		{
			if (TraceTemplatesSynthesis)
			{
				var trace = new MorphCoOccurrenceTrace(cooccurrence, usage);
				((Trace)input.CurrentTraceObject).AddChild(trace);

			}
		}
Exemplo n.º 3
0
		public override void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input)
		{
			if (TraceTemplatesSynthesis)
			{
				((XElement)input.CurrentTraceObject).Add(Write("MorphCooccurrenceRuleFailed", cooccurrence, usage));
			}
		}
Exemplo n.º 4
0
		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;
		}
Exemplo n.º 5
0
		public abstract void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input);