wc

wc is a rubygem to count word occurrences in a given text.

NEWS This is a major rewrite since version 0.98.2 and the API is completely rewritten from scratch. The expected behavior is to let wc gem to extend a plain ruby String object and use it to retrieve tag cloud. Please note that reading words from a file will be removed in further releases.

Usage

Using wc is easy. Just require the gem and use the to_tag_cloud method to the string containing the text you want to transform in a tag cloud

  require 'wc'

  "A text longer is here".to_tag_cloud ~> "<ul id=\"cloud\"><li><a href=\"#\" class=\"tag0\">text</a></li><li><a href=\"#\" class=\"tag0\">longer</a></li><li><a href=\"#\" class=\"tag0\">here</a></li></ul>" 

Note on Patches/Pull Requests

 

Copyright

Copyright © 2011 Paolo Perego. See LICENSE for details.