Generate greeklish forms from Greek words.
Add this line to your application's Gemfile:
gem 'greeklish'
And then execute:
$ bundle
Or install it yourself as:
$ gem install greeklish
Obtain an instance of GreeklishConverter
as follows:
converter = Greeklish.converter(max_expansions: 2,
generate_greek_variants: false)
greeklish_words = converter.convert('ομπρελα') # => ["omprela", "obrela"]
The option max_expansions
denotes the maximum greeklish expansions for
each greek word, i.e:
converter = Greeklish.converter(max_expansions: 4,
generate_greek_variants: false)
converter.convert('αυτοκινητο') # =>
["autokinhto", "aftokinhto", "avtokinhto", "aytokinhto"]
The option generate_greek_variants
denotes if greek variants should
be generated, i.e:
converter = Greeklish.converter(max_expansions: 2,
generate_greek_variants: true)
converter.convert('αμαξι') # =>
["amaksi", "amaxi", "amaksiou", "amaxiou", "amaksia", "amaxia",
"amaksiwn", "amaxiwn"]
Based on: elasticsearch-analysis-greeklish
- Fork it ( https://github.com/[my-github-username]/greeklish/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request