class Eman::Dictionary
Constants
- INDICES_FILE
- WORDS_FILE
Public Class Methods
find_similar(word)
click to toggle source
# File lib/eman/dictionary.rb, line 9 def self.find_similar(word) index = fetch_index(word) fetch_words(index) end
Private Class Methods
fetch_index(key)
click to toggle source
# File lib/eman/dictionary.rb, line 16 def self.fetch_index(key) indices = YAML.load_file(INDICES_FILE) indices[key] end
fetch_words(index)
click to toggle source
# File lib/eman/dictionary.rb, line 21 def self.fetch_words(index) words_list = YAML.load_file(WORDS_FILE) words_list[index] || [] end