Syllabize is a simple syllable counter written in Ruby.
Add this line to your application's Gemfile:
gem 'syllabize'
And then execute:
$ bundle
Or install it yourself as:
$ gem install syllabize
First, require syllabize
. Then, you can call the count_syllables
method on a string.
require 'syllabize'
# => true
'Ruby'.count_syllables
# => 2
As of version 0.6.0, syllabize now supports numbers and multiword strings.
require 'syllabize'
# => true
'500'.count_syllables
# => 3
'this gem is cool'.count_syllables
# => 4
The English language is full of exceptions to rules. One of the best ways to contribute is to file an issue with any exceptions you find.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Write tests and run them (
rake
orrspec
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request