Method: Query::Engine::Sogou.suggestions

Defined in:
lib/query/engine/sogou.rb

.suggestions(word) ⇒ Object



22
23
24
25
26
# File 'lib/query/engine/sogou.rb', line 22

def suggestions(word)
  suggestions = HTTParty.get "http://w.sugg.sogou.com/sugg/ajaj_json.jsp?key=#{URI.encode(word)}"
  suggestions = suggestions.encode('utf-8').scan /#{word}[^"]+/
  suggestions
end