/greeklish_iso843

Convert Greek text to Greeklish conforming to ISO 843 (ELOT 743)

Primary LanguageRubyMIT LicenseMIT

greeklish_iso843

A Ruby library that converts Greek text to Greeklish, conforming to the ISO 843 (ELOT 743) standard used by the Greek State.

Installation

As a Gem:

gem install greeklish_iso843

Use

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.

To-do

  • Tests 😅

Acknowledgements

This library is a Ruby port of an official implementation in JavaScript.

License

MIT

Author

Angelos Orfanakos