This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

cognitive-tools
TypeScript icon, indicating that this package has built-in type declarations

0.4.2 • Public • Published

Wrapper on top of Azure Cognitive Services

const TextAnalytics = require('cognitive-tools').TextAnalytics;
const textAnalytics = new TextAnalytics({key: process.env.TEXTANALYTICSKEY, endpoint: process.env.TEXTANALYTICSSENDPOINT });

const text = "I'm an oak tree."

textAnalytics.detect(text).then(results=>{
    
    const detectedLanguage = results.documents[0].detectedLanguages[0].name; 

    // "English"
    console.log((detectedLanguage));
}).catch(err=>{
    console.log(err);
})

Package Sidebar

Install

npm i cognitive-tools

Weekly Downloads

0

Version

0.4.2

License

Apache-2.0

Unpacked Size

28.3 kB

Total Files

18

Last publish

Collaborators

  • diberry