class SpellerYandex::Main

Public Class Methods

parse(text, wrong_words) click to toggle source
# File lib/speller_yandex/main.rb, line 4
def self.parse text, wrong_words
  array = JSON.parse  wrong_words
  array.each do |hash|
    word = hash["word"]
    s = hash["s"].join
    text = text.gsub(word, s)
  end
text
end