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

webtranslateit/word_count

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A word counter for String and Hash in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages