1.0.0 • Published 2 months ago

trumposwere v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

Trumposwere

A collection of text analytics functions for Node.js applications.

Installation

You can install this module via npm: npm install trumposwere

Usage

const textAnalytics = require('text-analytics-kit');

// Tokenize text
const text = "The quick brown fox jumps over the lazy dog";
console.log('Tokenized:', textAnalytics.tokenize(text));

// Calculate term frequency
const document = "The quick brown fox jumps over the lazy dog";
console.log('Term Frequency:', textAnalytics.calculateTermFrequency(document));

// Calculate inverse document frequency
const documents = [
  "The quick brown fox jumps over the lazy dog",
  "The lazy dog slept in the sun"
];
console.log('Inverse Document Frequency:', textAnalytics.calculateInverseDocumentFrequency(documents));