/// <summary> /// Returns suggestions for an input string. /// </summary> /// <param name="input">Input string</param> protected override IEnumerable <string> GetSuggestionImpl(string input) { return(Words .Where(x => !string.IsNullOrEmpty(x) && x.First() == input.First() && x.Last() == input.Last()) .Where(x => Match(input, x)) .Where(x => x.Length > GetMinimumWordlength(input)) .OrderBy(x => TextDistance.GetDamerauLevenshteinDistance(input, x))); }
/// <summary> /// Returns suggestions for an input string. /// </summary> /// <param name="input">Input string</param> protected override IEnumerable <string> GetSuggestionImpl(string input) { return(Words.OrderBy(x => TextDistance.GetDamerauLevenshteinDistance(input, x))); }