예제 #1
0
 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);
 }