コード例 #1
0
        public void SuffixGroup_ReduceTest4()
        {
            SuffixGroup group = new SuffixGroup("nan$", "nana$", "naa$");
            string      prefix;

            Assert.AreEqual(new SuffixGroup("n$", "na$", "a$"), group.Reduce(out prefix));
            Assert.AreEqual("na", prefix);
        }
コード例 #2
0
        public void SuffixGroup_ReduceTest2()
        {
            SuffixGroup group = new SuffixGroup("test$");
            string      prefix;

            Assert.AreEqual(group, group.Reduce(out prefix));
            Assert.AreEqual("test$", prefix);
        }
コード例 #3
0
        public void SuffixGroup_BuildGroupsTest2()
        {
            SuffixGroup group = new SuffixGroup("a$", "na$", "ana$", "nana$", "anana$", "banana$");

            SuffixGroup[] expected = new SuffixGroup[] {
                new SuffixGroup("a$", "ana$", "anana$"),
                new SuffixGroup("na$", "nana$"),
                new SuffixGroup("banana$"),
            };
            CollectionAssertEx.AreEquivalent(expected, group.BuildGroups());
        }
コード例 #4
0
 public static void Assert(this SuffixGroup @this, params string[] expectedSuffixes)
 {
     CollectionAssert.AreEqual(expectedSuffixes, @this.Suffixes);
 }
コード例 #5
0
        public void SuffixGroup_BuildGroupsTest1()
        {
            SuffixGroup group = new SuffixGroup("$");

            CollectionAssertEx.AreEqual(group.Yield(), group.BuildGroups());
        }
コード例 #6
0
        public void SuffixTreeBuilder_CreateRootSuffixGroupTest2()
        {
            SuffixGroup group = SuffixTreeBuilder.BuildSuffixGroup("sample$");

            group.Assert("e$", "le$", "ple$", "mple$", "ample$", "sample$");
        }