class Dictionary
Constants
- DEFAULT_FLAGS
- FUZZY_MATCH_MAX_DISTANCE
- WN_BIN
- WN_DICT_DIR
Public Class Methods
Source
# File plugins/dictionary.rb, line 35 def self.allowed_token?(token) DictionaryLookup.allowed_token?(token) end
Source
# File plugins/dictionary.rb, line 51 def self.clean_line(line) DictionaryReport.clean_line(line) end
Source
# File plugins/dictionary.rb, line 21 def self.command_pattern /dict (.+)/i end
Source
# File plugins/dictionary.rb, line 83 def self.default_run DictionaryLookup.default_run end
Source
# File plugins/dictionary.rb, line 47 def self.format_sense_line(line) DictionaryReport.plain_sense_line(line) end
Source
# File plugins/dictionary.rb, line 59 def self.format_wn_output(raw, word:, search_label:, corrected_word: nil) DictionaryReport.format_wn_output(raw, word: word, search_label: search_label, corrected_word: corrected_word) end
Source
# File plugins/dictionary.rb, line 67 def self.fuzzy_suggest_word(needle, words:, max_distance: DictionaryLookup::FUZZY_MATCH_MAX_DISTANCE) DictionaryLookup.fuzzy_suggest_word(needle, words: words, max_distance: max_distance) end
Source
# File plugins/dictionary.rb, line 31 def self.invalid_query_message DictionaryLookup.invalid_query_message end
Source
# File plugins/dictionary.rb, line 63 def self.levenshtein_distance(a, b) DictionaryLookup.levenshtein_distance(a, b) end
Source
# File plugins/dictionary.rb, line 87 def self.lookup(query, run: default_run, words: nil) DictionaryLookup.lookup(query, run: run, words: words) end
Source
# File plugins/dictionary.rb, line 39 def self.parse_query(text) DictionaryLookup.parse_query(text) end
Source
# File plugins/dictionary.rb, line 79 def self.run_lookup(word, flags, run:) DictionaryLookup.run_lookup(word, flags, run: run) end
Source
# File plugins/dictionary.rb, line 43 def self.search_label(flags) DictionaryLookup.search_label(flags) end
Source
# File plugins/dictionary.rb, line 55 def self.truncate_text(text, max_length = DictionaryReport::MAX_LINE_LENGTH) DictionaryReport.truncate_text(text, max_length) end
Source
# File plugins/dictionary.rb, line 27 def self.usage_message DictionaryLookup.usage_message end
Source
# File plugins/dictionary.rb, line 75 def self.wn_miss?(output, status) DictionaryLookup.wn_miss?(output, status) end
Source
# File plugins/dictionary.rb, line 71 def self.wordnet_words(dict_dir: DictionaryLookup::WN_DICT_DIR, loader: DictionaryLookup.method(:load_words_from_dict)) DictionaryLookup.wordnet_words(dict_dir: dict_dir, loader: loader) end
Public Instance Methods
Source
# File plugins/dictionary.rb, line 91 def execute(m, query) themed_flood_safe_reply(m, self.class.lookup(query)) end