New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

empath-sentiment-analysis

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empath-sentiment-analysis - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "empath-sentiment-analysis",
"version": "1.0.1",
"version": "1.0.2",
"description": "Tools to analyse sentiment in the browser",

@@ -5,0 +5,0 @@ "main": "empath.js",

@@ -1,2 +0,2 @@

Empath can be used to perform client side sentiment analysis. It is designed to work with emails.
Empath lets you perform client side sentiment analysis. It is designed to work with emails.

@@ -10,12 +10,17 @@ Features include:

Usage:
1. npm install --save-dev empath-sentiment-analysis
2. Sentiment analyser:
**Install module**
`npm install --save-dev empath-sentiment-analysis`
**Using Sentiment Analyser**
Modified from https://github.com/thisandagain/sentiment/blob/master/lib/index.js
```
import empath from 'empath-sentiment-analysis';
empath.analyseSentiment(phrase = '', attributesOfInterest = []);
```
Result:
```
{

@@ -31,11 +36,15 @@ wordListDidNotMatch: tryAnotherWordList,

};
```
Attribute scores are useful if you have a number of products for which you want to analyse sentiment. Review the test cases for more details.
3. DISC Profile Guesser
**Using DISC Profile Guesser**
```
import empath from 'empath-sentiment-analysis';
empath.guessDISCProfile.getUserReadableDISCProfile(email);
```
result:
```
{

@@ -47,2 +56,3 @@ 'D': D,

}
```

@@ -54,22 +64,27 @@ or

4. Email parser
**Using Email parser**
```
import empath from 'empath-sentiment-analysis';
const emailWithoutSignatureAndQuotedReplies = empath.parseEmail(email);
```
If you supply an email with a long signature and quoted replies from the thread, it will trim everything except the first email.
5. Readability analyser
**Using Readability analyser**
```
import empath from 'empath-sentiment-analysis';
const readabilityScore = empath.calculateReadabilityScore(email);
```
Anything above 4.0 is considered advanced vocab
6. Egoism analyser
**Egoism analyser**
```
import empath from 'empath-sentiment-analysis';
const egoismScore = empath.analyseEgoism(email);
```
Result:
```
{

@@ -80,2 +95,3 @@ selfish,

};
```

@@ -86,2 +102,2 @@ Selfish = number of selfish words used

Ratio can yield interesting insights about personality
Ratio can yield interesting insights about personality
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