A Ruby library that converts Greek text to Greeklish, conforming to the ISO 843 (ELOT 743) standard used by the Greek State.
As a Gem:
gem install greeklish_iso843
Require the library in your code:
require 'greeklish_iso843'
Then you can use it to convert text:
GreeklishIso843::Converter.convert("Μπάμπης") # => "Bampis"
GreeklishIso843::Converter.convert("Άγγελος") # => "Angelos"
GreeklishIso843::Converter.convert("Ευάγγελος") # => "Efangelos"
Alternatively, you can require the String
core extension for more convenience:
require 'greeklish_iso843/core_ext/string'
Then you can use it to convert text:
"Μπάμπης".to_greeklish # => "Bampis"
"Άγγελος".to_greeklish # => "Angelos"
"Ευάγγελος".to_greeklish # => "Efangelos"
There's also a command line utility that accepts Greek text from the standard input and prints the corresponding Greeklish text to the standard output:
$ greeklish_iso843
Μπάμπης
Άγγελος
Ευάγγελος
^D
Bampis
Angelos
Efangelos
$
Note: ^D
represents the EOF (End Of File) character, emitted with Ctrl-D
.
- Tests 😅
This library is a Ruby port of an official implementation in JavaScript.