关于配置BING拼写检查为独立单字校验的技术咨询
Hey there, let's work through this issue where Bing Spell Check is overcorrecting your specific term "medical suppliers" to "medical supplies"—even though "suppliers" on its own never gets flagged.
First, let's break down why this happens: Bing's default spell check behavior uses contextual analysis to suggest what it thinks is the most natural or commonly used phrase. In this case, it assumes "medical supplies" is the intended term because it's more widely used, but that's not aligned with your system's required terminology.
Here are three actionable solutions to get the behavior you want (validating individual words without contextual influence):
1. Switch to the proof mode in the Bing Spell Check API
Bing's API offers two main modes, and swapping from the default spell mode to proof will shift its focus entirely. The proof mode prioritizes catching actual spelling/grammar errors instead of suggesting contextually alternative phrases. Since neither "medical" nor "suppliers" is misspelled, this mode will leave the phrase intact and won't second-guess the word combination.
When making your API request, just set the mode parameter to proof—this should immediately stop the unwanted correction for "medical suppliers" while still catching real typos in other queries.
2. Add "medical suppliers" to a custom dictionary
If you want to keep some contextual checks for other phrases but need to protect specific terms like this, create a custom dictionary in your Bing Spell Check configuration. Add the exact phrase "medical suppliers" as a valid, approved term. This tells the API to treat this phrase as correct and skip any replacement suggestions for it.
This is a great middle ground if you don't want to disable all contextual analysis, just override it for your system-specific terminology.
3. Manually validate each word individually
As a fallback, you can bypass Bing's contextual analysis entirely by splitting the search query into individual words, running spell check on each one separately, then recombining them. Since "suppliers" on its own never triggers a correction, the combined phrase will stay as "medical suppliers".
Here's a quick pseudocode example of how you could implement this:
def check_spell_per_word(search_query): # Split query into individual words words = search_query.split() # Run spell check on each word via the API corrected_words = [bing_spell_check_api(word) for word in words] # Recombine into the final query return ' '.join(corrected_words)
Just note that this approach will ignore any legitimate contextual fixes you might want for other phrases, so test it with your typical search traffic to make sure it doesn't break other use cases.
内容的提问来源于stack exchange,提问作者Bill Chang

