module Conjugate::French

Public Instance Methods

common_name(t) click to toggle source

stubbed method individual languages override this to support multiple tenses names

# File lib/conjugate/french.rb, line 43
def common_name(t)
  return nil unless t
  actual_tense = t.to_s.gsub(' ', '_').to_sym
  @changable_names ||= {:past => :passe_compose, :passé_composé => :passe_compose}
  actual_tense = @changable_names[actual_tense] || actual_tense
  actual_tense
end
conjugation_template_finder(template, tense, opts) click to toggle source
# File lib/conjugate/french.rb, line 26
def conjugation_template_finder(template, tense, opts)
  if tense == :passe_compose
    if is_etre_verb(opts[:verb])
      FrenchTemplates[:être][:present][opts[:pronoun].to_sym] + ' ' + template[:past_participle]
    else
      FrenchTemplates[:avoir][:present][opts[:pronoun].to_sym] + ' ' + template[:past_participle]
    end
  else
    template[tense][opts[:pronoun].to_sym]
  end
end
find_irregular(verb) click to toggle source
# File lib/conjugate/french.rb, line 18
def find_irregular(verb)
  FrenchIrregularVerbs[verb.downcase]
end
generate_list_of_know_irregular_verbs() click to toggle source
# File lib/conjugate/french.rb, line 14
def generate_list_of_know_irregular_verbs
  puts "- " + FrenchIrregularVerbs.keys.sort.join("\n- ")
end
is_etre_verb(verb) click to toggle source
# File lib/conjugate/french.rb, line 38
def is_etre_verb(verb)
  ['monter', 'rester', 'sortir', 'venir', 'aller', 'naître', 'descendre', 'entrer', 'retourner', 'tomber', 'renter', 'arriver', 'mourir', 'partir', 'passer', 'décéder', 'redescendre', 'rentrer', 'remonter', 'repartir', 'renaître', 'retomber', 'ressortir', 'devenir', 'parvenir', 'revenir', 'survenir', 'provenir', 'intervenir', 'convenir', 'contrevenir', 'advenir'].include? verb.downcase
end
template(opts) click to toggle source
# File lib/conjugate/french.rb, line 22
def template(opts)
  FrenchTemplates[(opts[:template] || find_irregular(opts[:verb]) || regular_ending(opts[:verb])).to_sym]
end