Module: YandexSpeller::Data

Defined in:
lib/yandex_speller/data.rb

Constant Summary collapse

DATA_URL =
"http://speller.yandex.net/services/spellservice.json/checkText"

Class Method Summary collapse

Class Method Details

.get(word) ⇒ Object



11
12
13
14
# File 'lib/yandex_speller/data.rb', line 11

def self.get word
  content=JSON.load(open(URI.parse(URI.encode(DATA_URL+'?'+'text='+word))))
  return content.empty? ? "OK!" : content[0]['s']
end