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

@owsas/sentiment-multilang

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@owsas/sentiment-multilang

Multilanguage AFINN-based sentiment analysis for Node.js

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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, German, Dutch and Italian. For languages other than english, it uses a locale transposition of AFINN-111 wordlist. The wordlist can be extended adding words too.

Emojis are also supported:

describe('Emoji', function() {
  test('It should detect the usage of emojis', function () {
    expect(sentiment('Te amo! 😍', 'es').vote).toEqual('positive');
  });
});

Installation

npm install @owsas/sentiment-multilang

Usage

// Require the sentiment-multilang module
const { sentiment } = require('@owsas/sentiment-multilang');
// Get the sentiment from a text in a supported language
const result = sentiment('I had the most wonderful stay', 'en');  // result.vote = 'positive'

Improvements

  • All languages were moved to langs directory in separate .json files
  • Code was moved to Typescript, and users can now see hints in their code
  • Tests were moved to jest
  • Testing with travis

Credits

Test

npm t # runs jest

Keywords

FAQs

Package last updated on 21 Dec 2018

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