/sixarm_ruby_unaccent

SixArm.com » Ruby » Unaccent replaces a string's accented characters with ASCII characters.

Primary LanguageRubyOtherNOASSERTION

SixArm.com → Ruby →
Unaccent gem

Gem Version Build Status Code Climate

Introduction

Replace a string's accent characters with ASCII characters.

Based on Perl Text::Unaccent from CPAN.

For docs go to http://sixarm.com/sixarm_ruby_unaccent/doc

Want to help? We're happy to get pull requests.

Install

Gem

To install this gem in your shell or terminal:

gem install sixarm_ruby_unaccent

Gemfile

To add this gem to your Gemfile:

gem 'sixarm_ruby_unaccent'

Require

To require the gem in your code:

require 'sixarm_ruby_unaccent'

Examples

French:

require "sixarm_ruby_unaccent"
str = "déjà vu";
str.unaccent => "deja vu";

Greek:

require "sixarm_ruby_unaccent"
str = "νέα" (aka "\x{03AD}\x{03BD}\x{03B1}")
str.unaccent => "νεα" (aka "\x{03B5}\x{03BD}\x{03B1}")