public static List <int> GetSuggestions(string userInput) { if (userInput == null) { return(null); } if (userInput != string.Empty) { t.suggestQueries(userInput); if (t.GetQuerySuggestions() != null && t.GetQuerySuggestions().Count >= 0) { Suggestions = new List <int>(t.GetQuerySuggestions()); return(Suggestions); } else { string[] w = userInput.Split(' '); if (w[w.Length - 1].Length >= 3) { Corrected = Rectify(userInput); return(GetSuggestions(Corrected)); } } } return(null); }
public static List <Query> getSuggestions(string userInput) { if (userInput == null) { return(null); } if (userInput != string.Empty) { t.suggestQueries(userInput); if (t.getQuerySuggestions() != null) { if (t.getQuerySuggestions().Count > 0) { Suggestions = new List <Query>(t.getQuerySuggestions()); return(Suggestions); } else { return(getSuggestions(Rectify(userInput))); } } } return(null); }