some questions about spellcheck

事必达 0 Reputation points
2023-10-10T02:42:49.3366667+00:00

I use api spellcheck , the status code is success ,but the flaggedTokens doesn't has value

the response head still is 'BingAPIs-Market: zh-CN' ,but I set parameter mkt=en-US

Hope Get your help,thanks.

the code:

string text="bill gatas";
 string uri="https://api.bing.microsoft.com/v7.0/spellcheck?mkt=en-US&mode=proof";
 var client = new HttpClient();
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", key);
  HttpResponseMessage response = null;
     var values = new Dictionary<string, string>();
            values.Add("text", text);
            var content = new FormUrlEncodedContent(values);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
            response = await client.PostAsync(uri, new FormUrlEncodedContent(values));
 string contentString = await response.Content.ReadAsStringAsync();
 if (response.IsSuccessStatusCode)
            {
 Newtonsoft.Json.Linq.JObject ja = (Newtonsoft.Json.Linq.JObject)JsonConvert.DeserializeObject(contentString);
                if (ja.Count > 0 && ja["flaggedTokens"].HasValues)
                {
}
}

Bing Spell Check
Bing Spell Check
A Bing service that detects and corrects spelling mistakes in your app.
30 questions
{count} votes