Class: Linguistics::Latin::Verb::LatinVerb::LatinVerbTypeEvaluator

Inherits:
Object
  • Object
show all
Defined in:
lib/linguistics/latin/verb/latinverb/latin_verb_type_evaluator.rb

Instance Method Summary collapse

Constructor Details

#initialize(first_pres, infinitive, classifier) ⇒ LatinVerbTypeEvaluator

Returns a new instance of LatinVerbTypeEvaluator.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/linguistics/latin/verb/latinverb/latin_verb_type_evaluator.rb', line 7

def initialize(first_pres, infinitive, classifier)
  return unless classifier.classification.to_s.split('::').last.eql?("Regular")
  @type = if  infinitive =~ /āre$/
    Linguistics::Latin::Verb::VerbTypes::First
  elsif infinitive =~ /ēre$/
    Linguistics::Latin::Verb::VerbTypes::Second
  elsif infinitive =~ /ere$/
    first_pres =~ /i.$/ ? Linguistics::Latin::Verb::VerbTypes::ThirdIO : Linguistics::Latin::Verb::VerbTypes::Third
  elsif infinitive =~ /.+īre$/
    Linguistics::Latin::Verb::VerbTypes::Fourth
  elsif (infinitive =~ /ī$/  and first_pres =~ /r$/)
    Linguistics::Latin::Verb::VerbTypes::Deponent
  else
    raise "Could not find a verb type for this verb #{infinitive} and #{first_pres}"
  end
end

Instance Method Details

#inspectObject



24
25
26
# File 'lib/linguistics/latin/verb/latinverb/latin_verb_type_evaluator.rb', line 24

def inspect
  return @type
end