Project

word_count

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Word Count
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.8.0

Runtime

 Project Readme

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