Module: Dictionary
- Defined in:
- lib/dictionary.rb,
lib/dictionary/anagram_extractor.rb
Overview
Module that contains the AnagramExtractor.
Defined Under Namespace
Modules: Error Classes: AnagramExtractor
Class Method Summary collapse
-
.extract_anagrams(file, export_location, in_c) ⇒ String
Extracts the anagrams from a file, and exports the results.
Class Method Details
.extract_anagrams(file, export_location, in_c) ⇒ String
Extracts the anagrams from a file, and exports the results.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dictionary.rb', line 16 def self.extract_anagrams(file, export_location, in_c) extractor = AnagramExtractor.new(file) extractor.extract! in_c extractor.export(export_location) "Exported anagram list to #{export_location}." rescue Error::FileNotFoundError "The source file seems to be missing." rescue Error::PathNotFoundError "The export path does not exist." rescue Error::FileAlreadyExistsError "The export file already exists." end |