README.md in indoor_voice-0.0.1 vs README.md in indoor_voice-0.0.2

- old
+ new

@@ -13,20 +13,29 @@ ```ruby require 'open-uri' require 'indoor_voice' -# You can use any word list and any language. Here's we use Scrabble words. +# You can use any word list. Here we use Scrabble words. url = 'https://scrabblehelper.googlecode.com/svn/trunk/ScrabbleHelper/src/dictionaries/TWL06.txt' words = open(url).readlines.map(&:chomp) -# :en is the BCP 47 code for English. +# You can use any language. :en is the BCP 47 code for English. model = IndoorVoice.new(words, :en) -model.setup +model.setup # wait a moment -model.downcase('HP AND IBM ARE TECHNOLOGY CORPORATIONS.') -# => "HP and IBM are technology corporations." +model.downcase('HP, IBM AND MICROSOFT ARE TECHNOLOGY CORPORATIONS.') +# => "HP, IBM and microsoft are technology corporations." + +model.titlecase('HP, IBM AND MICROSOFT ARE TECHNOLOGY CORPORATIONS.') +# => "HP, IBM And Microsoft Are Technology Corporations." + +model.titlecase('HP, IBM AND MICROSOFT ARE TECHNOLOGY CORPORATIONS.', except: %w(a an and as at but by en for if in of on or the to via)) +# => "HP, IBM and Microsoft Are Technology Corporations." + +model.titlecase('HP, IBM AND MICROSOFT ARE TECHNOLOGY CORPORATIONS.', except: words) +# => "HP, IBM and Microsoft are technology corporations." ``` ![This gem is magic.](http://i.giphy.com/ol57TlMlftsQg.gif) IndoorVoice is based on the assumption that most acronyms contain non-word character sequences. For example, no English word has the character sequence `bm` in a word-final position, therefore `IBM` must be an acronym. @@ -39,6 +48,6 @@ * [titleize](https://rubygems.org/gems/titleize), [titlecase](https://rubygems.org/gems/titlecase), [title_case](https://rubygems.org/gems/title_case) and [gruber-case](https://rubygems.org/gems/gruber-case), based on [TitleCase.pl](http://daringfireball.net/2008/05/title_case) by John Gruber * [namecase](https://rubygems.org/gems/namecase), based on [Lingua::EN::NameCase](http://search.cpan.org/~barbie/Lingua-EN-NameCase-1.19/lib/Lingua/EN/NameCase.pm) by Mark Summerfield * [clever_title](https://rubygems.org/gems/clever_title) -Copyright (c) 2014 James McKinney, released under the MIT license +Copyright (c) 2015 James McKinney, released under the MIT license