Exemplo n.º 1
0
        public void Match_Fuzzy1()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(4, dmp.Match("abcdefghijk", "efxhi", 0), "match_bitap: Fuzzy match #1.");
        }
Exemplo n.º 2
0
        public void Match_Fuzzy2()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(2, dmp.Match("abcdefghijk", "cdefxyhijk", 5), "match_bitap: Fuzzy match #2.");
        }
Exemplo n.º 3
0
        public void Match_MultipleSelect2()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(8, dmp.Match("abcdexyzabcde", "abccde", 5), "match_bitap: Multiple select #2.");
        }
Exemplo n.º 4
0
        public void Match_Exact2()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(5, dmp.Match("abcdefghijk", "fgh", 0), "match_bitap: Exact match #2.");
        }
Exemplo n.º 5
0
        public void Match_Treshold2()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.3f, 100));

            Assert.AreEqual(-1, dmp.Match("abcdefghijk", "efxyhi", 1), "match_bitap: Threshold #2.");
        }
Exemplo n.º 6
0
        public void Match_Treshold3()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.0f, 100));

            Assert.AreEqual(1, dmp.Match("abcdefghijk", "bcdef", 1), "match_bitap: Threshold #3.");
        }
        public void Match_BeyondEndMatch()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(3, dmp.Match("abcdef", "defyy", 4), "match_bitap: Beyond end match.");
        }
        public void Match_BeforeStartMatch()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(0, dmp.Match("abcdef", "xxabc", 4), "match_bitap: Before start match.");
        }
        public void Match_Overflow()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(2, dmp.Match("123456789xx0", "3456789x0", 2), "match_bitap: Overflow.");
        }
        public void Match_Fuzzy3()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(-1, dmp.Match("abcdefghijk", "bxy", 1), "match_bitap: Fuzzy match #3.");
        }
        public void Match_OversizedPattern()
        {
            var dmp = new BitapAlgorithm(new MatchSettings(0.5f, 100));

            Assert.AreEqual(0, dmp.Match("abcdef", "xabcdefy", 0), "match_bitap: Oversized pattern.");
        }