Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lissy93/sentiment-analysis

🎈 A Node.js AFINN-111 based sentiment analysis module
https://github.com/lissy93/sentiment-analysis

affinn browserify javascript nodejs quick sentiment-analysis sentiment-sweep sentimental

Last synced: about 2 months ago
JSON representation

🎈 A Node.js AFINN-111 based sentiment analysis module

Awesome Lists containing this project

README

        

Sentiment Analysis



A light-weight sentiment analysis NPM module, based on the AFINN-111 word list










### Usage

Simply install [`sentiment-analysis`](https://www.npmjs.com/package/sentiment-analysis) via Yarn/ NPM/ pnpm, then import and use it.

```bash
npm i sentiment-analysis
```

```javascript
sentimentAnalysis = require('sentiment-analysis');

sentimentAnalysis('Dinosaurs are awesome!'); // +0.4
sentimentAnalysis('Everything is stupid'); // -0.2
sentimentAnalysis('JavaScript sucks'); // -0.3
sentimentAnalysis('My life is a catastrophic disaster'); // -0.6
```

For a more detailed usage example, see [this example Gist](https://gist.github.com/Lissy93/0d9a3d5dc9d9c49c7b4b9319a7715703)

---

### Developing

To make changes, clone the project, cd into it, install dev dependencies then start Gulp watch.

```bash
git clone [email protected]:Lissy93/sentiment-analysis.git
cd sentiment-analysis
npm i
```

The entry point, and bulk of the logic is in the [`index.coffee`](https://github.com/Lissy93/sentiment-analysis/blob/master/index.coffee) file.

The following scripts are availible:
- `npm run dev` - Watch for file changes and rebuild the project for development
- `npm run build` - Run tests, then lint, compile and minify the project for production
- `npm run test` - Execute unit tests, quality gates, and coverage
- `npm run example` - Run the example script

---

### Testing

After cloning, run `yarn test` to execute the unit tests and generate quality and coverage report. The following files will be executed:

- [`utils.test.coffee`](https://github.com/Lissy93/sentiment-analysis/blob/master/test/utils.test.coffee) - All utility unit tests
- [`main.test.coffee`](https://github.com/Lissy93/sentiment-analysis/blob/master/test/main.test.coffee) - Main integration tests

Any new features added must be tested, and all tests must be passing before any changes can be merged.

---

### Contributing

Contributions are welcome :)
Please be sure to follow the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).

---

### License

For license explanation, see [TLDR Legal > MIT](https://tldrlegal.com/license/mit-license)

```
The MIT License (MIT)
Copyright (c) Alicia Sykes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included install
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```



© Alicia Sykes 2015

Licensed under MIT



Thanks for visiting :)