Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@botbuildercommunity/spell-check-middleware

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botbuildercommunity/spell-check-middleware

Bot Framework middleware component for the Cognitive Services Spell Check API

  • 0.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
3
Weekly downloads
 
Created
Source

Spell Check Middleware

The Spell Check Middleware offers Bot Framework middleware components for the Cognitive Services Bing Spell Check API. You will need an Azure account, as well as a Cognitive Services resource created on Azure. Take a look at the Bing Spell Check API documentation for details.

Installing

npm install @botbuildercommunity/spell-check-middleware --save

Usage

All middleware is created and use in the same way. For example, for spell check, import the SpellCheck class from the package, and add it to your bot adapter:

import { SpellCheck } from '@botbuildercommunity/spell-check-middleware';

adapter.use(new SpellCheck(YOUR_BING_SPELL_CHECK_KEY));

When used, the turnState on the TurnContext will have a property named suggestion which is the actual suggestion. Furthermore turnState will have a property token which is the phrase which has been classified by the service to be replaced by the suggestion. A full example can be seen in the bot.js bot test file.

Supported middleware classes include:

  • SpellCheck

Each class takes the one required parameter like in the example usage above.

In each case, properties are added to the turnState of the TurnContext You can retrieve them in your bot via:

  • context.turnState.get("token") //This is the token which you could replace by suggestion
  • context.turnState.get("suggestion") //This is the suggestion which the token could be replaced with

Keywords

FAQs

Package last updated on 26 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc