Skip to content

Commit

Permalink
Add verb pronunciations
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysonvirissimo committed Nov 28, 2023
1 parent bcacec4 commit 6827a2f
Show file tree
Hide file tree
Showing 4 changed files with 242 additions and 236 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
medieval_latina (2.0.4)
medieval_latina (2.0.5)
i18n

GEM
Expand Down
16 changes: 11 additions & 5 deletions lib/medieval_latina.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def self.adverb?(word)
end

def self.noun?(word)
NOUNS.member?(prepare_word(word))
NOUNS.key?(prepare_word(word))
end

def self.verb?(word)
VERBS.member?(prepare_word(word))
VERBS.key?(prepare_word(word))
end

def self.adjectives
Expand All @@ -61,7 +61,7 @@ def self.adverbs
end

def self.nouns
NOUNS
NOUNS.keys
end

def self.rejoin_words(array)
Expand All @@ -74,15 +74,21 @@ def self.rejoin_words(array)
end

def self.verbs
VERBS
VERBS.keys
end

def self.word?(string)
string.match?(/\w/)
end

def self.words
ADJECTIVES | ADVERBS | Set.new(DICTIONARY.keys) | NOUNS | VERBS
[
ADJECTIVES,
ADVERBS,
DICTIONARY,
NOUNS,
VERBS
].flat_map(&:keys).each_with_object(Set.new) { |word, set| set.add(word) }
end

def initialize(word)
Expand Down
Loading

0 comments on commit 6827a2f

Please sign in to comment.