Esempio n. 1
0
        public void Test()
        {
            var         setA           = new bool[] { false, false, true, true };
            var         setB           = new bool[] { true, true, false, false };
            var         setSimilairToA = new bool[] { false, true, true, true };
            var         setSimilairToB = new bool[] { true, true, true, false };
            IClassifier classifier     = Create();

            classifier.Train("a", setA);
            classifier.Train("b", setB);
            var shouldBeA = classifier.FindMatches(setSimilairToA).OrderByDescending(m => m.Strength).First();
            var shouldBeB = classifier.FindMatches(setSimilairToB).OrderByDescending(m => m.Strength).First();

            Console.WriteLine("Should be A strength {0}", shouldBeA.Strength);
            Console.WriteLine("Should be B strength {0}", shouldBeB.Strength);
            Assert.AreEqual(shouldBeA.Identifier, "a");
            Assert.AreEqual(shouldBeB.Identifier, "b");
        }