SpellChecker.Net.Search.Spell.SpellChecker.Close C# (CSharp) Метод

Close() публичный Метод

public Close ( ) : void
Результат void
        public void Close()
        {
            lock (searcherLock)
            {
                EnsureOpen();
                closed = true;
                if (searcher != null)
                {
                    searcher.Close();
                }
                searcher = null;
            }
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Gets the similar words.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="fieldName">Name of the field.</param>
        /// <param name="word">The word.</param>
        /// <returns></returns>
        private static string[] SuggestSimilar(IndexReader reader, string fieldName, string word)
        {
            var spell = new SpellChecker.Net.Search.Spell.SpellChecker(reader.Directory());

            spell.IndexDictionary(new LuceneDictionary(reader, fieldName));
            var similarWords = spell.SuggestSimilar(word, 2);

            // now make sure to close the spell checker
            spell.Close();

            return(similarWords);
        }
All Usage Examples Of SpellChecker.Net.Search.Spell.SpellChecker::Close