Skip to content

jrobertson/yawc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages