Пример #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;
		}
Пример #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);

			}
		}
Пример #3
0
		public override void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input)
		{
			if (TraceTemplatesSynthesis)
			{
				((XElement)input.CurrentTraceObject).Add(Write("MorphCooccurrenceRuleFailed", cooccurrence, usage));
			}
		}
Пример #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;
		}
Пример #5
0
		public abstract void MorphCooccurrenceRuleFailed(MorphCoOccurrence cooccurrence, string usage, WordSynthesis input);