0.0
No commit activity in last 3 years
No release in over 3 years
Counts words in a file and prints them out in interesting ways.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

WordCounter

Counts words from either a file or a website, and prints a report to stdout.

Build Status Gem Version

Installation

Add this line to your application's Gemfile:

gem 'word_counter'

And then execute:

$ bundle

Or install it yourself as:

$ gem install word_counter

Usage

To count a website's words:

$ word_counter www.example.com
Results:
2 Domain
2 Example
2 domain
2 examples
2 for
2 in
1 More
1 This
1 You
1 asking
1 be

To count a file's words:

$ word_counter ./path/to/my/file.txt

Use the -s switch to also report which lines contained the counted word (can result in lot of text output, so you might want to pipe it to less):

$ word_counter www.example.com -s | less
Results:
2 Domain
    1: Example Domain
2 Example
    1: Example Domain
2 domain
    1: This domain is established to be used for illustrative examples in documents. You may use this
    2: domain in examples without prior coordination or asking for permission.
2 examples
    1: This domain is established to be used for illustrative examples in documents. You may use this
    2: domain in examples without prior coordination or asking for permission.

With all the options:

$ word_counter www.example.com -s -c | less -R

Options

  • -c Colorize output
  • -s Show sentences containing the words in question

Roadmap

  • Ignore common words (a, for, it, the, of, etc.)
  • Ignore case

Contributing

  1. Fork it ( http://github.com/wulftone/word_counter/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request