Oxide::Utils::SuggestionList
Inherits Reference < Object
Provides fuzzy matching suggestions using Levenshtein distance algorithm. Used to generate "Did you mean?" messages for GraphQL errors.
Constants
MAX_SUGGESTIONS = 5
Class methods
did_you_mean_message(suggestions : Array(String)) : String | Nil
Formats suggestions into a "Did you mean?" message. Returns nil if no suggestions provided.
suggest(input : String, options : Array(String)) : Array(String)
Returns up to 5 best matches from options based on Levenshtein distance. Uses a threshold of 40% of input length to filter suggestions.