示例#1
0
        public void WordIndex_MultipleBlocks()
        {
            WordIndex index = new WordIndex(new DefaultWordSplitter());

            for (int i = 0; i < 70000; ++i)
            {
                string word = "Word" + i.ToString();
                index.AddWord(1, word);
                if (i % 5 == 0)
                {
                    index.AddWord(2, word);
                }
            }

            Assert.AreEqual("1", GetMatchExact(index, "Word6"));
            Assert.AreEqual("1, 2", GetMatchExact(index, "Word5"));
            Assert.AreEqual("1, 2", GetMatchExact(index, "Word69000"));
        }