diff --git a/README.md b/README.md index dd49149..e3af417 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ require 'aws-sdk-polly' polly = Aws::Polly::Client.new(region: 'us-west-2') # Add the lexicons -MedievalLatina::Lexicon.files_with_contents.each do |name, context| +MedievalLatina::Lexicon.file_names_with_contents.each do |name, content| polly.put_lexicon(name: name, content: content) end diff --git a/lib/medieval_latina/lexicon.rb b/lib/medieval_latina/lexicon.rb index 068ac8a..6f14149 100644 --- a/lib/medieval_latina/lexicon.rb +++ b/lib/medieval_latina/lexicon.rb @@ -17,9 +17,9 @@ def self.get_file_content(file_name) File.read(path) end - def self.files_with_contents + def self.file_names_with_contents list_files.each_with_object({}) do |file_path, files_content| - file_name = File.basename(file_path) + file_name, _extension = File.basename(file_path).split(".") files_content[file_name] = get_file_content(file_name) end end