Ejemplo n.º 1
0
        public void TestResult()
        {
            TestSerialize();

            var bloom = BloomFilter.Deserialize("C:/temp/bloom.txt", 1);
            var data  = File.ReadAllLines("c:/temp/ID025-false-positives.txt");

            var score = data
                        .Select(word => bloom.test(ProcessWord(word)))
                        .Where(r => !r)
                        .Count();

            var percent = score * 100 / (double)data.Count();

            Console.WriteLine(Math.Round(percent, 2) + "%");

            var dictData  = File.ReadAllLines("c:/temp/words.txt");
            var dictScore = dictData
                            .Select(word => bloom.test(ProcessWord(word)))
                            .Where(r => r)
                            .Count();

            var dictPercent = dictScore * 100 / (double)dictData.Count();

            Console.WriteLine(Math.Round(dictPercent, 2) + "%");
        }