Textstat is an utility to get statistics about text content.
The main reason behind this is me wanting to hack on a nice little project. Textstat happens to be well suited to explore new technologies.
I am glad about any suggestions since I'm only learning here. Feel free to use the Issues / Pull Request.
(There's also a Ruby version of this project.)
- Download the binary and you are good to go.
- Optional you can add it to your
$PATH
.
Textstat can be used as a command-line tool or imported as Go package.
You can pass a path to a file:
textstat-go texts/shakespeare.txt
Or stream content to Textstat:
echo 'some content' | textstat-go
textstat-go < texts/shakespeare.txt
cat texts/shakespeare.txt | textstat-go
To analyze a whole folder you could run:
find . -type f -print0 | xargs -0 cat | textstat-go
Import the package:
import (
textstat "github.com/jorin-vogel/textstat-go/lib"
)
For now see textstat.go details on the API.
- Make sure you have Go installed.
- Download the repo:
go get github.com/jorin-vogel/textstat-go
- Test the code with
go test
orgo test -cover
. - Update the binary using
go install
.
MIT