Use search engine to correct results from speech recognition. Currently leverages Bing's Did you mean
. Vevo. Spotify.
yarn add SayMosaic/did-you-mean-bing
const { didYouMean, aggressiveDidYouMeanSpotify } = require('did-you-mean-bing')
didYouMean
, returns corrected query, return null when query is already accuracy
didYouMean('play fireworks by katy perry')
// 'play firework by katy perry'
aggressiveDidYouMeanSpotify
, aggressively finds a track/album/artist/playlist on spotify. Returns the item with its spotify id
, and type
. If it's a playlist, userId
will also be returned.
aggressiveDidYouMeanSpotify('play fireworks by katy perry')
// {type: 'track', id: '1mXuMM6zjPgjL4asbBsgnt'}
Run test,
yarn run test
Apache License 2.0