Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sixarm/sixarm_ruby_unaccent

SixArm.com » Ruby » Unaccent replaces a string's accented characters with ASCII characters.
https://github.com/sixarm/sixarm_ruby_unaccent

accent gem parser ruby string unaccent

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# SixArm.com → Ruby →
Unaccent gem

[![Gem Version](https://badge.fury.io/rb/sixarm_ruby_unaccent.svg)](http://badge.fury.io/rb/sixarm_ruby_unaccent)
[![Build Status](https://travis-ci.org/SixArm/sixarm_ruby_unaccent.png)](https://travis-ci.org/SixArm/sixarm_ruby_unaccent)
[![Code Climate](https://api.codeclimate.com/v1/badges/162f0f19afdb800182e0/maintainability)](https://codeclimate.com/github/SixArm/sixarm_ruby_unaccent/maintainability)

* Git:
* Doc:
* Gem:
* Contact: Joel Parker Henderson,
* Project: [changes](CHANGES.md), [license](LICENSE.md), [contributing](CONTRIBUTING.md).

## Introduction

Replace a string's accent characters with ASCII characters.

Based on Perl Text::Unaccent from CPAN.

For docs go to

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}")