Beispiel #1
0
        public IList <string> FindSimilarWords(string value, bool substringsAreSimilar)
        {
            var result = _bkTree.Find(value, threshold: null);

            using (var spellChecker = new WordSimilarityChecker(value, substringsAreSimilar))
            {
                return(result.Where(spellChecker.AreSimilar).ToArray());
            }
        }
Beispiel #2
0
        public IList <string> FindSimilarWords(string value, bool substringsAreSimilar)
        {
            var result = _bkTree.Find(value, threshold: null);

            var checker = WordSimilarityChecker.Allocate(value, substringsAreSimilar);
            var array   = result.Where(checker.AreSimilar).ToArray();

            checker.Free();

            return(array);
        }