multi-text-analyzer
v1.1.0
Published
A text analyzer that can analyze multiple texts at once. It can analyze the number of words, syllables, and reading time of a text.
Downloads
17
Maintainers
Readme
Multi Text Analyzer
A lightweight npm package for analyzing text.
The package finds the following stats:
- Words count.
- Char count (with and without spaces).
- Sentences.
- Paragraphs.
- Punctuations.
- Syllables (accurate and estimated).
- Long words (more than six chars).
- Hard words (contain three or more syllables).
- Top five repeated words.
- Reading time estimate.
Installation
npm install multi-text-analyzer
Usage
Import calculate instance:
import { calculate } from "multi-text-analyzer";
const text = "This is a great package!";
calculate.chars(text).withSpaces;
Notes
- Most repeated words output returns the word and its count:
[
{ word: "and", count: 8 },
{ word: "a", count: 7 },
{ word: "in", count: 6 },
{ word: "i", count: 4 },
{ word: "an", count: 4 },
];
Reading time returned value is a string, eg: "1 min".
The
accurateSyllables()
method only runs on server as it needs to access fs.
Dependencies
- syllable: used in calculate.syllables().
- lodash.
- reading-time: used in calculate.readingTimeEstimate().
- syllable-count-english: calculate.accurateSyllables().
Contributions
Any contribution is welcomed and highly appreciated.