Exemplo n.º 1
0
        public void TestSpecificityMetrics()
        {
            var documentIndexer = ServiceLocator.Resolve<DocumentIndexer>();
            var analyzer = ServiceLocator.Resolve<Analyzer>();

            PreRetrievalMetrics preMetrics = new PreRetrievalMetrics(documentIndexer.Reader, analyzer);
            Assert.IsTrue(preMetrics.AvgIdf("splitting") > preMetrics.AvgIdf("searching"));
            Assert.IsTrue(preMetrics.AvgIdf("solution closing") > preMetrics.AvgIdf("indexer"));
        }
Exemplo n.º 2
0
        public void TestSimilarityMetrics()
        {
            var documentIndexer = ServiceLocator.Resolve<DocumentIndexer>();
            var analyzer = ServiceLocator.Resolve<Analyzer>();

            PreRetrievalMetrics preMetrics = new PreRetrievalMetrics(documentIndexer.Reader, analyzer);
            Assert.IsTrue(preMetrics.AvgSqc("indexer") > preMetrics.AvgSqc("potato chip"));
            Assert.IsTrue(preMetrics.AvgSqc("indexer") > preMetrics.AvgSqc("soda pop"));
        }
Exemplo n.º 3
0
        public void TestStemmingForMetricsCalculation()
        {
            var documentIndexer = ServiceLocator.Resolve<DocumentIndexer>();
            var analyzer = ServiceLocator.Resolve<Analyzer>();

            PreRetrievalMetrics preMetrics = new PreRetrievalMetrics(documentIndexer.Reader, analyzer);
            Assert.AreEqual(preMetrics.StemText("searching"), "search");
            Assert.AreEqual(preMetrics.StemText("search"), "search");
            Assert.AreEqual(preMetrics.StemText("solution closing"), "solut close");
            Assert.AreEqual(preMetrics.StemText("indexer"), "index");
        }