Exemple #1
0
 public string SpellCheckByPage([FromBody] SpellCheckJsonData spellChecker)
 {
     try
     {
         SpellChecker spellCheck = new SpellChecker(spellDictionary, personalDictPath);
         spellCheck.CheckSpelling(spellChecker.LanguageID, spellChecker.TexttoCheck);
         return(Newtonsoft.Json.JsonConvert.SerializeObject(spellCheck));
     }
     catch
     {
         return("{\"SpellCollection\":[],\"HasSpellingError\":false,\"Suggestions\":null}");
     }
 }
Exemple #2
0
 public HttpResponseMessage SpellCheckByPage([FromBody] SpellCheckJsonData spellChecker)
 {
     try
     {
         SpellChecker spellCheck = new SpellChecker(spellDictionary, personalDictPath);
         spellCheck.CheckSpelling(spellChecker.LanguageID, spellChecker.TexttoCheck);
         string json = Newtonsoft.Json.JsonConvert.SerializeObject(spellCheck);
         return(new HttpResponseMessage()
         {
             Content = new StringContent(json)
         });
     }
     catch
     {
         return(new HttpResponseMessage()
         {
             Content = new StringContent("{\"SpellCollection\":[],\"HasSpellingError\":false,\"Suggestions\":null}")
         });
     }
 }