Example #1
0
        public Hoot(string IndexPath, string FileName, bool DocMode, ITokenizer tokenizer)
        {
            if (tokenizer != null)
            {
                _tokenizer = tokenizer;
            }
            else
            {
                _tokenizer = new tokenizer();
            }
            _Path     = IndexPath;
            _FileName = FileName;
            _docMode  = DocMode;
            if (_Path.EndsWith(Path.DirectorySeparatorChar.ToString()) == false)
            {
                _Path += Path.DirectorySeparatorChar;
            }
            Directory.CreateDirectory(IndexPath);

            _log.Debug("Starting hOOt....");
            _log.Debug("Storage Folder = " + _Path);

            if (DocMode)
            {
                _docs = new KeyStoreString(_Path + "files.docs", false);
                // read deleted
                _deleted    = new BoolIndex(_Path, "_deleted", ".hoot");
                _lastDocNum = (int)_docs.Count();
            }
            _bitmaps = new BitmapIndex(_Path, _FileName + "_hoot.bmp");
            // read words
            LoadWords();
        }
Example #2
0
        public void NumericWords()
        {
            _config.IgnoreNumerics = true;

            var c = new RaptorDB.tokenizer().GenerateWordFreq(s, _config);

            Assert.AreEqual(26, c.Count);
        }
Example #3
0
        public void TestStopList()
        {
            _config.UseStopList = true;
            var t = new RaptorDB.tokenizer();

            t.InitializeStopList(_config.IndexPath);

            var b = t.GenerateWordFreq(s, _config);

            Assert.AreEqual(31, b.Count);
        }
Example #4
0
        public void Words()
        {
            var d = new RaptorDB.tokenizer().GenerateWordFreq(s, _config);

            Assert.AreEqual(32, d.Count);
        }