README

readingtime

Estimate text reading times

Documentation

Overview

    Package readingtime estimates text reading times

    We use non-scientific means of first establishing the number of words in a given text and then based on read speeds from http://www.readingsoft.com/ calculate the time required to read that number of words in the text.

    Index

    Constants

    View Source
    const (
    	InsufficientScreenReaderSpeed = 100.0
    	InsufficientPaperReaderSpeed  = 110.0
    	AverageScreenReaderSpeed      = 200.0
    	AveragePaperReaderSpeed       = 240.0
    	FastScreenReaderSpeed         = 300.0
    	FastPaperReaderSpeed          = 400.0
    	AccomplishedScreenReaderSpeed = 700.0
    	AccomplishedPaperReaderSpeed  = 1000.0
    )

      Reader profile average reading times in words per minute from http://www.readingsoft.com/

      Variables

      View Source
      var (
      	DefaultWordsPerMinute = AverageScreenReaderSpeed
      	DefaultWords          = regexp.MustCompile(`\s`)
      	DefaultRound          = time.Second
      	Default               = Estimator{}
      )

        Defaults.

        Functions

        func Estimate

        func Estimate(text string) time.Duration

          Estimate the reading time for a given text using defaults.

          Types

          type Estimator

          type Estimator struct {
          	WordsPerMinute float64
          
          	// Words matcher.
          	Words *regexp.Regexp
          
          	// Round duration value, set to 1 to disable rounding.
          	Round time.Duration
          
          	// NoStrip skips trimming of white space characters.
          	NoStrip bool
          }

            Estimator can estimate the reading time.

            func (Estimator) Estimate

            func (e Estimator) Estimate(text string) time.Duration

              Estimate the reading time for a given text.

              Source Files