This repository has been archived by the owner. It is now read-only.
Textstat is a cli tool to get statistics about text content
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
texts
README.md
license
main.go
screenshot.png

README.md

textstat-go

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.

Preview

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.)

Setup

Usage

Textstat can be used as a command-line tool or imported as Go package.

Command-line

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

Go API

Import the package:

import (
  textstat "github.com/jorin-vogel/textstat-go/lib"
)

For now see textstat.go details on the API.

Development

Requirements

  • Make sure you have Go installed.

Setup

  • Download the repo: go get github.com/jorin-vogel/textstat-go

Workflow

  • Test the code with go test or go test -cover.
  • Update the binary using go install.

License

MIT