Categorygithub.com/mdigger/wstat
modulepackage
1.0.0
Repository: https://github.com/mdigger/wstat.git
Documentation: pkg.go.dev

# README

Simple text statistic library

Go Reference

Library for quick counting the simplest statistics on the text:

  • the total number of characters,
  • the number of spaces and separators,
  • the number of punctuation symbols,
  • the number of digits,
  • the number of words,
  • allows you to perform calculations in the stream or addition of individual lines,
  • supports selection of text from HTML
  • counting the number of machine-visiting (typewritten) pages and author's pages
  • calculation of reading time for different languages and/or different speeds
stat := wstat.FromString(`text data`)
fmt.Println("reading time:", stat)

# Functions

Bytes returns statistical information about the text from bytes.
FromHTML extracts text from HTML and returns statistical information on text.
ReadFrom returns statistical information about the text from stream.
String returns statistical information about the text from string.
Sum returns a new statistics counter with summared data.

# Variables

In the USSR and the Russian Federation, an account of the author's leaf is equal to 40,000 printed signs (including punctuation marks, numbers and spaces between words to the fields).
IgnoreHTMLTags contains the list of names of the HTML tags, the contents of which are ignored.
One typewritten page accommodates 1860 printed signs (including spaces).

# Structs

Counter contains data with statistical counting results.