Project

yawc

0.0
Low commit activity in last 3 years
No release in over a year
Yet Another Word Counter (YAWC) makes it convenient to count the number of words in a string and return the result as a hash object.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.1, >= 0.1.1
 Project Readme

Introducing the Yawc gem

require 'yawc'

s = '

Rubbish in, rubbish out. Test123 123 test @dfgf test rest

Mary had a little lamb,
His fleece was white as snow,
And everywhere that Mary went,
The lamb was sure to go.

He followed her to school one day,
Which was against the rule,
It made the children laugh and play
To see a lamb at school.

And so the teacher turned it out,
But still it lingered near,
And waited patiently about,
Till Mary did appear.

"Why does the lamb love Mary so?"
The eager children cry.
"Why, Mary loves the lamb, you know,"
The teacher did reply
'

h = Yawc.new(s).to_h

#=> {"mary"=>5, "lamb"=>5, "was"=>3, "rubbish"=>2, "out"=>2, "test"=>2, ...

Resources

yawc gem wordcount