This is a simple JavaScript library for text analysis, providing functionalities such as sentiment analysis and word frequency analysis.
Install the package via npm:
npm install natural text-analysis- Require the
text-analysispackage in your Node.js application:
const { analyzeSentiment, analyzeWordFrequency } = require('text-analysis');- Use the provided functions to analyze text:
const text = "I love coding and programming!";
const sentimentScore = analyzeSentiment(text);
console.log('Sentiment score:', sentimentScore);
const frequencyMap = analyzeWordFrequency(text);
console.log('Word frequency:', frequencyMap);Analyzes the sentiment of the given text and returns a sentiment score.
Analyzes the frequency of words in the given text and returns a map with words as keys and their frequencies as values.
This project is licensed under the MIT License - see the LICENSE file for details. ac81e70afceb39f8c22d77df2cd2bb953b7492b8