Socket
Book a DemoInstallSign in
Socket

@botbuildercommunity/text-recognizer-middleware

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botbuildercommunity/text-recognizer-middleware

A collection of Bot Framework middleware components that uses Microsoft's recognizer text suite to parse inbound messages, and extract useful information.

latest
Source
npmnpm
Version
0.2.4
Version published
Weekly downloads
2
Maintainers
3
Weekly downloads
 
Created
Source

Text Recognizer Middleware

The Text Recognizer Middleware library is a compliment to the Text Recognizer dialog prompts. These middleware components can be used to identify certain text sequences that you might want to alter prior to appearing on the chat window. For example, turning a URL into an actual link, or turning a hashtag into a link that points to a Twitter search.

Installing

npm install @botbuildercommunity/text-recognizer-middleware --save

Usage

All middleware is created and used in the same way. For example, for social media recognition, import the SocialMediaRecognizer class from the package, and add it to your bot adapter:

import { SocialMediaRecognizer } from "@botbuildercommunity/text-recognizer-middleware";

adapter.use(new SocialMediaRecognizer());

When used, the turnState on the TurnContext will have a property named mentionEntities, which will be an array of strings with the @ syntax elements.

Supported middleware classes include:

ClassProperty/Properties on turnState
EmailRecognizercontext.turnState.get("emailEntities")
URLRecognizercontext.turnState.get("urlEntities")
PhoneRecognizercontext.turnState.get("phoneNumberEntities")
SocialMediaRecognizercontext.turnState.get("mentionEntities") or context.turnState.get("hastagEntities")

In each case, the turnState of the TurnContext contains an array with the various recognized entities.

Keywords

chatbots

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