Class: Fonetica
- Inherits:
-
Object
- Object
- Fonetica
- Includes:
- Singleton
- Defined in:
- lib/fonetica.rb,
lib/fonetica/version.rb
Constant Summary collapse
- VERSION =
'1.0.0'
Instance Method Summary collapse
Instance Method Details
#foneticalize(word) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fonetica.rb', line 33 def foneticalize(word) result = word.gsub(/รง/i, 's') result = I18n.transliterate(result).upcase replacements.each do |search, replace| result.gsub!(search, replace) end result.squeeze end |