Skip to content

Commit 7f527f8

Browse files
authored
Updated structure, fixed bug
1 parent 862c7b7 commit 7f527f8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

python/Search/BingAutosuggestv7.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@
33

44
# -*- coding: utf-8 -*-
55

6-
import http.client, urllib.parse, json
6+
'''
7+
This sample uses the Bing Autosuggest API to check the spelling of query words and then suggests corrections.
8+
Bing Spell Check API: https://docs.microsoft.com/en-us/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference57855119bca1df1c647bc358
9+
'''
710

8-
# **********************************************
9-
# *** Update or verify the following values. ***
10-
# **********************************************
11+
import http.client
12+
import json
13+
import os
14+
import urllib.parse
1115

1216
# Add your Bing Autosuggest subscription key to your environment variables.
1317
subscriptionKey = os.environ['BING_AUTOSUGGEST_SUBSCRIPTION_KEY']
1418

1519
# Add your Bing Autosuggest endpoint to your environment variables.
1620
host = os.environ['BING_AUTOSUGGEST_ENDPOINT']
21+
host = host.replace('https://', '')
1722
path = '/bing/v7.0/Suggestions'
1823

1924
mkt = 'en-US'

0 commit comments

Comments
 (0)