GithubHelp home page GithubHelp logo

webjose / read-per-minute Goto Github PK

View Code? Open in Web Editor NEW

This project forked from untemps/read-per-minute

0.0 0.0 0.0 269 KB

Class to parse a string and return an estimated reading time based on a lang rate

License: MIT License

Shell 2.37% JavaScript 97.63%

read-per-minute's Introduction

@untemps/read-per-minute

Class to parse a long text and return an estimated reading time based on a lang rate.

npm GitHub Workflow Status Codecov

Installation

yarn add @untemps/read-per-minute

Usage

Import ReadPerMinute:

import { ReadPerMinute } from '@untemps/read-per-minute'

Create an instance of ReadPerMinute:

const rpm = new ReadPerMinute()

Call the parse method with a string and a lang:

rpm.parse('Long text', 'en')

Get the parsed values:

const estimatedReadingTime = rpm.time
const numberOfWords = rpm.words
const langRate = rpm.rate

Alternative Use with a Custom Rate

Simply pass the desired custom reading rate in words per minute instead of a language code:

// For very fast readers: 425 words per minute.
rpm.parse('Long text', 425)

NOTE: The custom reading rate must be greater than zero or the default value will be used.

Rates

Reading rates by lang come from "How many words do we read per minute? A review and meta-analysis of reading rate" by Marc Brysbaert - Department of Experimental Psychology Ghent University

Lang Rate
default 200
ar 181
zh 260
nl 228
en 236
fi 195
fr 214
de 260
he 224
it 285
ko 226
es 278
sv 218

If the lang is not listed or is undefined, the default value will be used.

read-per-minute's People

Contributors

untemps avatar semantic-release-bot avatar webjose avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.