Skip to content

Commit

Permalink
List file names without extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysonvirissimo committed Apr 28, 2024
1 parent 1b49e5c commit 708f4d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/medieval_latina/lexicon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 708f4d4

Please sign in to comment.