Skip to content

Commit 459e6ce

Browse files
author
dksimpson
committed
Refresh Bing Spell Check REST API quickstarts
1 parent 2454ce2 commit 459e6ce

File tree

7 files changed

+82
-69
lines changed

7 files changed

+82
-69
lines changed

articles/cognitive-services/Bing-Spell-Check/quickstarts/csharp.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,31 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-spell-check
1010
ms.topic: quickstart
11-
ms.date: 12/16/2019
11+
ms.date: 05/19/2020
1212
ms.author: aahi
1313
---
1414

1515
# Quickstart: Check spelling with the Bing Spell Check REST API and C#
1616

17-
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple C# application sends a request to the API and returns a list of suggested corrections. While this application is written in C#, the API is a RESTful Web service compatible with most programming languages. The source code for this application is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/dotnet/Search/BingAutosuggestv7.cs).
17+
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple C# application sends a request to the API and returns a list of suggested corrections.
18+
19+
Although this application is written in C#, the API is a RESTful Web service compatible with most programming languages. The source code for this application is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/dotnet/Search/BingAutosuggestv7.cs).
1820

1921
## Prerequisites
2022

2123
* Any edition of [Visual Studio 2017 or later](https://www.visualstudio.com/downloads/).
22-
* To install `Newtonsoft.Json` as a NuGet package in Visual studio:
23-
1. In **Solution Explorer**, right-click the Solution file.
24-
1. Select **Manage NuGet Packages for Solution**.
25-
1. Search for `Newtonsoft.Json` and install the package.
24+
* The Newtonsoft.Json NuGet package.
25+
To install this package in Visual studio:
26+
1. In **Solution Explorer**, right-click the Solution file.
27+
1. Select **Manage NuGet Packages for Solution**.
28+
1. Search for *Newtonsoft.Json* and install the package.
2629
* If you're using Linux/MacOS, this application can be run using [Mono](https://www.mono-project.com/).
2730

2831
[!INCLUDE [cognitive-services-bing-spell-check-signup-requirements](../../../../includes/cognitive-services-bing-spell-check-signup-requirements.md)]
2932

3033
## Create and initialize a project
3134

32-
1. Create a new console solution named `SpellCheckSample` in Visual Studio. Then add the following namespaces into the main code file.
35+
1. Create a new console solution named SpellCheckSample in Visual Studio. Then, add the following namespaces into the main code file:
3336

3437
```csharp
3538
using System;
@@ -41,7 +44,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
4144
using Newtonsoft.Json;
4245
```
4346

44-
2. Create variables for the API endpoint, your subscription key, and the text to be spell checked. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
47+
2. Create variables for the API endpoint, your subscription key, and the text to be spell checked. You can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
4548

4649
```csharp
4750
namespace SpellCheckSample
@@ -57,15 +60,15 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
5760
}
5861
```
5962

60-
3. Create a variable for your search parameters. Append your market code after `mkt=`. The market code is the country you make the request from. Also, append your spell-check mode after `&mode=`. Mode is either `proof` (catches most spelling/grammar errors) or `spell` (catches most spelling but not as many grammar errors).
63+
3. Create a variable for your search parameters. Append your market code to the `mkt=` parameter. The market code is the code of the country you make the request from. Append your spell-check mode to the `&mode=` parameter. The mode is either `proof` (catches most spelling/grammar errors) or `spell` (catches most spelling errors, but not as many grammar errors).
6164

6265
```csharp
6366
static string params_ = "mkt=en-US&mode=proof";
6467
```
6568

6669
## Create and send a spell check request
6770

68-
1. Create an asynchronous function called `SpellCheck()` to send a request to the API. Create a `HttpClient`, and add your subscription key to the `Ocp-Apim-Subscription-Key` header. Then perform the following steps within the function.
71+
1. Create an asynchronous function called `SpellCheck()` to send a request to the API. Create a `HttpClient`, and add your subscription key to the `Ocp-Apim-Subscription-Key` header. Within the function, follow the next steps.
6972

7073
```csharp
7174
async static void SpellCheck()
@@ -122,7 +125,7 @@ Console.WriteLine(jsonObj);
122125

123126
## Call the spell check function
124127

125-
In the Main function of your project, call `SpellCheck()`.
128+
In the `Main()` function of your project, call `SpellCheck()`.
126129

127130
```csharp
128131
static void Main(string[] args)
@@ -184,4 +187,4 @@ A successful response is returned in JSON, as shown in the following example:
184187
> [Create a single-page web app](../tutorials/spellcheck.md)
185188
186189
- [What is the Bing Spell Check API?](../overview.md)
187-
- [Bing Spell Check API v7 Reference](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-spell-check-api-v7-reference)
190+
- [Bing Spell Check API v7 reference](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-spell-check-api-v7-reference)

articles/cognitive-services/Bing-Spell-Check/quickstarts/java.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,27 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-spell-check
1111
ms.topic: quickstart
12-
ms.date: 12/16/2019
12+
ms.date: 05/19/2020
1313
ms.author: aahi
1414
---
1515

1616
# Quickstart: Check spelling with the Bing Spell Check REST API and Java
1717

18-
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple Java application sends a request to the API and returns a list of suggested corrections. While this application is written in Java, the API is a RESTful web service compatible with most programming languages. The source code for this application is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/java/Search/BingSpellCheck.java).
18+
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple Java application sends a request to the API and returns a list of suggested corrections.
19+
20+
Although this application is written in Java, the API is a RESTful web service compatible with most programming languages. The source code for this application is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/java/Search/BingSpellCheck.java).
1921

2022
## Prerequisites
2123

2224
* The Java Development Kit(JDK) 7 or later.
2325

24-
* Import the [gson-2.8.5.jar](https://libraries.io/maven/com.google.code.gson%3Agson) or the most current [Gson](https://github.com/google/gson) version. For command line execution, add the `.jar` to your Java folder with the main class.
26+
* Import the [gson-2.8.5.jar](https://libraries.io/maven/com.google.code.gson%3Agson) or the most current [Gson](https://github.com/google/gson) version. For command-line execution, add the `.jar` to your Java folder with the main class.
2527

2628
[!INCLUDE [cognitive-services-bing-spell-check-signup-requirements](../../../../includes/cognitive-services-bing-spell-check-signup-requirements.md)]
2729

2830
## Create and initialize an application
2931

30-
1. Create a new Java Project in your favorite IDE or editor with a class name of your choosing, and then import the following packages.
32+
1. Create a new Java Project in your favorite IDE or editor with a class name of your choosing, and then import the following packages:
3133

3234
```java
3335
import java.io.*;
@@ -36,7 +38,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
3638
import javax.net.ssl.HttpsURLConnection;
3739
```
3840

39-
2. Create variables for the API endpoint's host, path, and your subscription key. Then create variables for your market, the text you want to spell check, and a string for the spell check mode. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
41+
2. Create variables for the API endpoint's host, path, and your subscription key. Then, create variables for your market, the text you want to spell check, and a string for the spell check mode. You can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
4042
4143
```java
4244
static String host = "https://api.cognitive.microsoft.com";
@@ -51,7 +53,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
5153
5254
## Create and send an API request
5355
54-
1. Create a function called `check()` to create and send the API request. Within it, follow these steps. Create a string for the request parameters. append the `?mkt=` parameter to your market string, and the `&mode=` parameter to your spell check mode.
56+
1. Create a function called `check()` to create and send the API request. Within it, follow the next steps. Create a string for the request parameters. Append your market string to the `?mkt=` parameter, and the spell-check mode to the `&mode=` parameter.
5557
5658
```java
5759
public static void check () throws Exception {
@@ -60,14 +62,14 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
6062
}
6163
```
6264
63-
2. Create a URL by combining the endpoint host, path and parameters string. Create a new `HttpsURLConnection` object.
65+
2. Create a URL by combining the endpoint host, path, and parameters string. Create a new `HttpsURLConnection` object.
6466
6567
```java
6668
URL url = new URL(host + path + params);
6769
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
6870
```
6971
70-
3. Open a connection to the URL. Set the request method to `POST`. Add your request parameters. Make sure to add your subscription key to the `Ocp-Apim-Subscription-Key` header.
72+
3. Open a connection to the URL. Set the request method to `POST` and add your request parameters. Be sure to add your subscription key to the `Ocp-Apim-Subscription-Key` header.
7173
7274
```java
7375
connection.setRequestMethod("POST");
@@ -76,7 +78,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
7678
connection.setDoOutput(true);
7779
```
7880
79-
4. Create a new `DataOutputStream` object and Send the request to the API.
81+
4. Create a new `DataOutputStream` object and send the request to the API.
8082
8183
```java
8284
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
@@ -87,7 +89,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
8789
8890
## Format and read the API response
8991
90-
1. Add this method to your class. It formats the JSON for a more readable output.
92+
1. Add the `prettify()` method to your class. It formats the JSON for a more readable output.
9193
9294
``` java
9395
// This function prettifies the json response.
@@ -113,7 +115,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
113115
114116
## Call the API
115117
116-
In the main function of your application, call your check() method created above.
118+
In the main function of your application, call your check() method created previously.
117119
```java
118120
public static void main(String[] args) {
119121
try {
@@ -129,7 +131,7 @@ In the main function of your application, call your check() method created above
129131
130132
Build and run your project.
131133
132-
If you're using the command line, use the following commands to build and run the application.
134+
If you're using the command line, use the following commands to build and run the application:
133135

134136
**Build:**
135137
```bash
@@ -189,4 +191,4 @@ A successful response is returned in JSON, as shown in the following example:
189191
> [Create a single-page web app](../tutorials/spellcheck.md)
190192
191193
- [What is the Bing Spell Check API?](../overview.md)
192-
- [Bing Spell Check API v7 Reference](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-spell-check-api-v7-reference)
194+
- [Bing Spell Check API v7 reference](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-spell-check-api-v7-reference)

articles/cognitive-services/Bing-Spell-Check/quickstarts/nodejs.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-spell-check
1111
ms.topic: quickstart
12-
ms.date: 12/16/2019
12+
ms.date: 05/19/2020
1313
ms.author: aahi
1414
---
1515

1616
# Quickstart: Check spelling with the Bing Spell Check REST API and Node.js
1717

18-
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple Node application sends a request to the API and returns a list of words it didn't recognize, followed by suggested corrections. While this application is written in Node.js, the API is a RESTful Web service compatible with most programming languages. The source code for this application is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/nodejs/Search/BingSpellCheckv7.js).
18+
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple JavaScript application sends a request to the API and returns a list of suggested corrections.
19+
20+
Although this application is written in JavaScript, the API is a RESTful Web service compatible with most programming languages. The source code for this application is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/nodejs/Search/BingSpellCheckv7.js).
1921

2022
## Prerequisites
2123

@@ -26,7 +28,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
2628

2729
## Create and initialize a project
2830

29-
1. Create a new JavaScript file in your favorite IDE or editor. Set the strictness, and require `https`. Then create variables for your API endpoint's host, path, and your subscription key. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
31+
1. Create a new JavaScript file in your favorite IDE or editor. Set the strictness, and require `https`. Then, create variables for your API endpoint's host, path, and your subscription key. You can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
3032

3133
```javascript
3234
'use strict';
@@ -37,7 +39,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
3739
let key = '<ENTER-KEY-HERE>';
3840
```
3941

40-
2. Create variables for your search parameters and the text you want to check. Append your market code after `mkt=`. The market code is the country you make the request from. Also, append your spell-check mode after `&mode=`. Mode is either `proof` (catches most spelling/grammar errors) or `spell` (catches most spelling but not as many grammar errors).
42+
2. Create variables for your search parameters and the text you want to check. Append your market code to the `mkt=` parameter. The market code is code for the country you make the request from. Append your spell-check mode to the `&mode=` parameter. The mode is either `proof` (catches most spelling/grammar errors) or `spell` (catches most spelling errors but not as many grammar errors).
4143

4244
```javascript
4345
let mkt = "en-US";
@@ -48,7 +50,7 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
4850

4951
## Create the request parameters
5052

51-
Create your request parameters by creating a new object with a `POST` method. Add your path by appending your endpoint path, and query string. Add your subscription key to the `Ocp-Apim-Subscription-Key` header.
53+
1. Create your request parameters by creating a new object with a `POST` method. Add your path by appending your endpoint path, and query string. Then, add your subscription key to the `Ocp-Apim-Subscription-Key` header.
5254

5355
```javascript
5456
let request_params = {
@@ -85,7 +87,7 @@ let response_handler = function (response) {
8587

8688
## Send the request
8789

88-
Call the API using `https.request()` with your request parameters, and response handler. Write your text to the API, and end the request afterwards.
90+
Call the API using `https.request()` with your request parameters and response handler. Write your text to the API, and end the request afterwards.
8991

9092
```javascript
9193
let req = https.request (request_params, response_handler);
@@ -96,13 +98,13 @@ req.end ();
9698

9799
## Run the application
98100

99-
Build and run your project.
101+
1. Build and run your project.
100102

101-
If you're using the command line, use the following commands to build and run the application.
103+
1. If you're using the command line, use the following commands to build and run the application:
102104

103-
```bash
104-
node <FILE_NAME>.js
105-
```
105+
```bash
106+
node <FILE_NAME>.js
107+
```
106108

107109

108110
## Example JSON response
@@ -150,7 +152,7 @@ A successful response is returned in JSON, as shown in the following example:
150152
## Next steps
151153

152154
> [!div class="nextstepaction"]
153-
> [Create a single page web-app](../tutorials/spellcheck.md)
155+
> [Create a single-page web app](../tutorials/spellcheck.md)
154156
155157
- [What is the Bing Spell Check API?](../overview.md)
156158
- [Bing Spell Check API v7 Reference](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-spell-check-api-v7-reference)

articles/cognitive-services/Bing-Spell-Check/quickstarts/php.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-spell-check
1111
ms.topic: quickstart
12-
ms.date: 12/16/2019
12+
ms.date: 05/19/2020
1313
ms.author: aahi
1414
---
1515
# Quickstart: Check spelling with the Bing Spell Check REST API and PHP
1616

17-
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple PHP application sends a request to the API and returns a list of suggested corrections. While this application is written in PHP, the API is a RESTful Web service compatible with most programming languages.
17+
Use this quickstart to make your first call to the Bing Spell Check REST API. This simple PHP application sends a request to the API and returns a list of suggested corrections.
18+
19+
Although this application is written in PHP, the API is a RESTful Web service compatible with most programming languages.
1820

1921
## Prerequisites
2022

@@ -23,12 +25,12 @@ Use this quickstart to make your first call to the Bing Spell Check REST API. Th
2325
[!INCLUDE [cognitive-services-bing-spell-check-signup-requirements](../../../../includes/cognitive-services-bing-spell-check-signup-requirements.md)]
2426

2527

26-
## Get Spell Check results
28+
## Get Bing Spell Check REST API results
2729

2830
1. Create a new PHP project in your favorite IDE.
2931
2. Add the code provided below.
3032
3. Replace the `subscriptionKey` value with an access key valid for your subscription.
31-
4. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
33+
4. You can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
3234
5. Run the program.
3335

3436
```php
@@ -135,7 +137,7 @@ A successful response is returned in JSON, as shown in the following example:
135137
## Next steps
136138

137139
> [!div class="nextstepaction"]
138-
> [Create a single page web-app](../tutorials/spellcheck.md)
140+
> [Create a single-page web app](../tutorials/spellcheck.md)
139141
140142
- [What is the Bing Spell Check API?](../overview.md)
141143
- [Bing Spell Check API v7 Reference](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-spell-check-api-v7-reference)

0 commit comments

Comments
 (0)