Anglicize¶ ↑
<img src=“https://badge.fury.io/rb/anglicize.svg” alt=“Gem Version” />
Anglicize is a simple gem that converts strings between American and English spellings, based on the list of alternate spellings at [www.tysto.com/uk-us-spelling-list.html].
For example:
-
“Blue Is The Warmest Color”.anglicize == “Blue Is The Warmest Colour”
-
“Blue Is The Warmest Colour”.americanize == “Blue Is The Warmest Color”
The methods provided will retain the case of the original string.
Installation¶ ↑
Add this to your Gemfile and run the bundle
command.
gem "anglicize"
Getting Started¶ ↑
The gem adds the following methods to the String object:
-
anglicize - return a copy of the string converted to English spelling
-
anglicize! - convert the string in-place to English spelling
-
has_alternate_english_spelling? - returns true if English spelling of string is different
-
americanize - return a copy of the string converted to American spelling
-
americanize! - convert the string in-place to American spelling
-
has_alternate_american_spelling? - returns true if American spelling of string is different
-
copy_case - applies the case of the string parameter and returns the resultant string
-
copy_case! - changes the case of the string to the case of the string parameter