public virtual void RunTest(string[] firstInput, string[] secondInput, string[] expectedOutput, params string[] labels) { IList <CoreLabel> input1 = CoreUtilities.ToCoreLabelList(words, tags, firstInput); IList <CoreLabel> input2 = CoreUtilities.ToCoreLabelList(words, tags, secondInput); IList <CoreLabel> result = CoreUtilities.ToCoreLabelList(words, tags, expectedOutput); ICollection <string> auxLabels = new HashSet <string>(); foreach (string label in labels) { auxLabels.Add(label); } ClassifierCombiner.MergeTwoDocuments(input1, input2, auxLabels, "O"); NUnit.Framework.Assert.AreEqual(result, input1); }
public virtual void OutputResults(string[] firstInput, string[] secondInput, string[] expectedOutput, params string[] labels) { IList <CoreLabel> input1 = CoreUtilities.ToCoreLabelList(words, tags, firstInput); IList <CoreLabel> input2 = CoreUtilities.ToCoreLabelList(words, tags, secondInput); IList <CoreLabel> result = CoreUtilities.ToCoreLabelList(words, tags, expectedOutput); ICollection <string> auxLabels = new HashSet <string>(); foreach (string label in labels) { auxLabels.Add(label); } ClassifierCombiner.MergeTwoDocuments(input1, input2, auxLabels, "O"); foreach (CoreLabel word in input1) { System.Console.Out.WriteLine(word.Word() + " " + word.Tag() + " " + word.Get(typeof(CoreAnnotations.AnswerAnnotation))); } }