Accord.Tests.MachineLearning.BagOfWordsTest.ComputeTest C# (CSharp) Method

ComputeTest() private method

private ComputeTest ( ) : void
return void
        public void ComputeTest()
        {
            BagOfWords target = new BagOfWords();

            target.Compute(texts);

            target.MaximumOccurance = Int16.MaxValue;

            string[] text = { "vestibulum", "vestibulum", "vestibulum" };

            int[] actual = target.GetFeatureVector(text);

            int actualIdx = 43;

            Assert.IsTrue(actual[actualIdx] == 3);

            for (int i = 0; i < actual.Length; i++)
            {
                if (i != actualIdx)
                    Assert.IsTrue(actual[i] == 0);
            }
        }