Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Latest commit

 

History

History
executable file
·
21 lines (14 loc) · 544 Bytes

readme.md

File metadata and controls

executable file
·
21 lines (14 loc) · 544 Bytes

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