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

sentiment-ptbr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentiment-ptbr

AFINN-based sentiment analysis for Node.js PS: modified by Aristeu Roriz for test use only

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

sentiment (pt-BR)

AFINN-based sentiment analysis for Node.js (pt-BR)

Forked from (https://github.com/thisandagain/sentiment) and modified by Aristeu Roriz for test use only

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

  • Performance (see benchmarks below)
  • The ability to append and overwrite word / value pairs from the AFINN wordlist
  • A build process that makes updating sentiment to future versions of the AFINN word list trivial

Installation

npm install sentiment

Usage

var sentiment = require('sentiment-ptbr');

var r1 = sentiment('Gatos são estúpidos!');
console.dir(r1);        // Score: -2, Comparative: -0.666

var r2 = sentiment('Gatos são incríveis!');
console.dir(r2);        // Score: 4, Comparative: 1

Adding / overwriting words

You can append and/or overwrite values from AFINN by simply injecting key/value pairs into a sentiment method call:

var sentiment = require('sentiment-ptbr');

var result = sentiment('Gatos são incríveis!', {
    'gatos': 5,
    'incríveis': 2  
});
console.dir(result);    // Score: 7, Comparative: 1.75

Keywords

FAQs

Package last updated on 22 Jun 2016

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