Socket
Socket
Sign inDemoInstall

sentiment-multilang

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sentiment-multilang

Multilanguage AFINN-based sentiment analysis for Node.js


Version published
Weekly downloads
46
decreased by-20.69%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

sentiment-multilang

Multilanguage AFINN-based sentiment analysis for Node.js

Sentiment is a Node.js module that uses the AFINN-111 wordlist to perform sentiment analysis on arbitrary blocks of input text.

It supports the following languages: English, French, Spanish, and Italian. For languages other than english, it uses a locale transposition of AFINN-111 wordlist. The wordlist can be extended adding words too.

Installation

npm install sentiment-multilang

Usage

// Require the sentiment-multilang module
var sentiment = require('sentiment-multilang');

// Use the module to get sentiment from texts.
var r1 = sentiment('Cats are stupid.','en');
console.dir(r1);        // Vote: 'negative'

var r2 = sentiment('Cats are totally amazing!','en');
console.dir(r2);        // Vote: 'positive'

var r3 = sentiment('I gatti sono stupidi.','it');
console.dir(r3);        // Vote: 'negative'

var r4 = sentiment('I gatti sono totalmente stupendi!','it');
console.dir(r4);        // Vote: 'positive'

Test

mocha test

Keywords

FAQs

Last updated on 09 Aug 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc