A word counter for String and Hash in Ruby
Ruby
Switch branches/tags
Nothing to show
Clone or download
Latest commit 62290fe Oct 11, 2013
Permalink
Failed to load latest commit information.
lib Initial commit Oct 11, 2013
spec Add more specs Oct 11, 2013
tmp Initial commit Oct 11, 2013
.gitignore Initial commit Oct 11, 2013
Gemfile Initial commit Oct 11, 2013
Guardfile Initial commit Oct 11, 2013
history.md Release 0.0.1 Oct 11, 2013
license Add license Oct 11, 2013
readme.md Initial commit Oct 11, 2013
word_count.gemspec Add license Oct 11, 2013

readme.md

word_count

This gem adds one word_count method to String and Hash. It calls the Unix wc system command to count the amount of words in a String or a Hash. Other ways to count words (using regexes) are unreliable for counting words in foreign languages.

Installation

# add this to your Gemfile
gem "word_count"

# and  run
bundle update

Usage

str = "the brown fox jumped over the lazy dog"
str.word_count # => 8

Copyright (c) 2013 Atelier Convivialité.