Project

contador

0.0
No commit activity in last 3 years
No release in over 3 years
This gem counts the numbers of words in a string. It returns each word and the multiplicity
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.0.0
~> 1.5.1
> 1.2.3
 Project Readme

TALLY

It a way to count the amount of times each word appears on a string.

INSTALL

gem install contador

USAGE

require contador

@sentence = Contador.new("Esto sale todo")

=> #<Contador:0x10212a860 @final={:esto=>1, :sale=>1, :todo=>1}, @string="Esto sale todo", @omit=[]>

@sentence.multiplicity

=> {:esto=>1, :sale=>1, :todo=>1}

OMITING FREQUENT WORDS

We use a global for omiting frequent words. For example:

$omits = "esto no sale"

=> "esto no sale"

@sentence = Contador.new("Esto sale todo")

=> #<Contador:0x102110b68 @final={:todo=>1}, @string="Esto sale todo", @omit=[]>

@sentence.multiplicity

=> {:todo=>1}

THANKS TO

Bakedweb.net to allow me to write ruby during work. Esturisti.co for needing the reports that allowed me to extract the functionality on this gem.