Comments (7)
Thanks for opening this issue (and @amarzavery for moving it to the correct repo). It looks like this is an auth issue with the cognitive services REST endpoint for spellcheck. We apologize for not getting to this sooner while it was open in the other repo. @stephanbisser, if you're still watching this issue, can you let us know if this is still happening for you?
from azure-sdk-for-js.
Hi @kurtzeborn I need to check it and come back to you asap with the result! Thanks
from azure-sdk-for-js.
Hi @stephanbisser,
Can you try again with the latest version of this SDK?
https://www.npmjs.com/package/@azure/cognitiveservices-spellcheck
Thanks,
Chris
from azure-sdk-for-js.
@sarangan12 If this doesnt repro with the latest re-generated code, then please close this issue
from azure-sdk-for-js.
Hi @stephanbisser, yeah that sample you found is a year old. The snippet below is current and working. Instructions on how to run are found here: https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/javascript/BingSpellCheck/bing_spell_check_quickstart.js
"use strict";
var SpellCheck = require("@azure/cognitiveservices-spellcheck");
var msRest = require("@azure/ms-rest-js");
const key = process.env['BING_SPELL_CHECK_SUBSCRIPTION_KEY'];
if (!key) {
throw new Error('Set/export a BING_SPELL_CHECK_SUBSCRIPTION_KEY environment variable.');
}
const endpoint = process.env['BING_SPELL_CHECK_ENDPOINT'];
if (!endpoint) {
throw new Error('Set/export a BING_SPELL_CHECK_ENDPOINT environment variable.');
}
const creds = new msRest.ApiKeyCredentials({ inHeader: { 'Ocp-Apim-Subscription-Key': key } });
const client = new SpellCheck.SpellCheckClient(creds, { endpoint: endpoint });
async function quickstart() {
let query = 'bill gtaes was eher';
let misspelledWords = [];
let suggestedWords = [];
await client.spellChecker(query)
.then((response) => {
console.log();
for (var i = 0; i < response._response.parsedBody.flaggedTokens.length; i++) {
var spellingFlaggedToken = response._response.parsedBody.flaggedTokens[i];
misspelledWords.push(spellingFlaggedToken.token);
var correction = spellingFlaggedToken.suggestions[0].suggestion; // gets each word
suggestedWords.push(correction);
}
console.log('Original query: ' + query);
console.log();
console.log('Misspelled words: ');
console.log(misspelledWords);
console.log();
console.log('Suggested correction(s): ');
console.log(suggestedWords);
}).catch((err) => {
throw err;
})
}
try {
quickstart();
}
catch (error) {
console.log(error);
}
from azure-sdk-for-js.
Closing the ticket given there has not been a response. Please re-open if this issue has not been resolved.
Thanks,
Chris
from azure-sdk-for-js.
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.
from azure-sdk-for-js.
Related Issues (20)
- Dependency package @rollup/plugin-commonjs has a new version available
- Dependency package chai-as-promised has a new version available
- Dependency package nyc has a new version available
- [appconfig][react-native] Value of a key is undefined HOT 3
- InvalidHeaderValue error thrown when acquiring a blob lease HOT 4
- wrong @TextAnalysisClient import from the @azure/ai-text-analytics package in text analytics documentation HOT 1
- Cannot find module 'node:os' in @azure/logger dependency of @azure/identity HOT 8
- @azure/storage-blob version 12.23.0, problems/bug with setPlatformSpecificData function, Cannot access member 'bun' of undefined. HOT 3
- `@azure/storage-file-share` - Missing headers in REST requests HOT 7
- AutoLockRenew keeps throwing timeout exception HOT 6
- Not clear how to narrow `BuildModelDefaultResponse | BuildModelLogicalResponse` when using `await poller.pollUntilDone()` HOT 4
- [ai-document-intelligence] Loading from an ESM module still doesn't seem to work fine. Still loads CJS HOT 2
- [EngSys] configure dependabot to ignore certain directories when opening upgrade pull requests
- outputContentFormat: 'markdown' leads to some features (keyValuePairs, queryFields) silently not working anymore.
- `DocumentAnalysisClient` and `ClassifyDocumentOptions` are inconsistent over different client SDKs HOT 1
- Vitest can't pick up environment variable TEST_MODE when targeting browser HOT 4
- [test][core-amqp] unstable request response test HOT 2
- isAvailable event is being triggered after a 30-40 second delay, in ACS Room Video Call HOT 1
- [App Configuration] AppConfigurationClient - FeatureFlag FeatureFlag configuration setting "before each" hook for "can add and get FeatureFlag" failing in nightly runs HOT 1
- [Eventhubs - Checkpointstore Blob] updates checkpoints successfully failing in nightly runs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-js.