Created
June 30, 2009 22:38
-
-
Save sgharms/138480 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From a075b71833cec1b673b3ab3dd566cc83b902091a Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Mon, 29 Jun 2009 02:11:59 -0500 | |
Subject: [PATCH 01/11] s/independant/independent/g | |
--- | |
README | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
mode change 100755 => 100644 README | |
diff --git a/README b/README | |
old mode 100755 | |
new mode 100644 | |
index 2753d40..f3c3708 | |
--- a/README | |
+++ b/README | |
@@ -29,7 +29,7 @@ | |
== General Information | |
Linguistics is a framework for building linguistic utilities for Ruby objects | |
-in any language. It includes a generic language-independant front end, a | |
+in any language. It includes a generic language-independent front end, a | |
module for mapping language codes into language names, and a module which | |
contains various English-language utilities. | |
-- | |
1.6.3.1 | |
From b23c7602f2f8989d2148fdaf2ff4bedcc9b6bac5 Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Mon, 29 Jun 2009 03:30:49 -0500 | |
Subject: [PATCH 02/11] Added LAtin class and initial test case set | |
--- | |
lib/linguistics/la.rb | 23 +++++++++++++++++++++++ | |
tests/la/first_conjugation.tests.rb | 32 ++++++++++++++++++++++++++++++++ | |
2 files changed, 55 insertions(+), 0 deletions(-) | |
create mode 100644 lib/linguistics/la.rb | |
create mode 100755 tests/la/first_conjugation.tests.rb | |
diff --git a/lib/linguistics/la.rb b/lib/linguistics/la.rb | |
new file mode 100644 | |
index 0000000..eeb15a5 | |
--- /dev/null | |
+++ b/lib/linguistics/la.rb | |
@@ -0,0 +1,23 @@ | |
+=begin rdoc | |
+ | |
+=Linguistics::LA | |
+ | |
+This module contains English-language linguistic functions for the Linguistics | |
+module. It can be either loaded directly, or by passing some variant of 'la' | |
+or 'lat' to the Linguistics::use method. | |
+ | |
+=end | |
+ | |
+module Linguistics::LA | |
+ # Insert requires here | |
+ | |
+ Linguistics::DefaultLanguages << :la | |
+ | |
+ ############### | |
+ module_function | |
+ ############### | |
+ | |
+ def razzle | |
+ puts "i say razzle" | |
+ end | |
+end | |
\ No newline at end of file | |
diff --git a/tests/la/first_conjugation.tests.rb b/tests/la/first_conjugation.tests.rb | |
new file mode 100755 | |
index 0000000..d3ba9a3 | |
--- /dev/null | |
+++ b/tests/la/first_conjugation.tests.rb | |
@@ -0,0 +1,32 @@ | |
+#!/usr/bin/ruby -w | |
+# | |
+# Unit test for (Latin Verb Conjugation: First conjugation: /.*āre/. | |
+# Canonical example: laudāre: to praise) | |
+# | |
+# Copyright (c) (2008-9) Steven G. Harms | |
+# | |
+ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+### This test case tests ... | |
+class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+ | |
+ def initialize( *args ) | |
+ super | |
+ Linguistics::use( :la ) | |
+ end | |
+ | |
+ def test_0000_loaded | |
+ assert_respond_to Linguistics::LA, :razzle | |
+ end | |
+ | |
+ | |
+end | |
+ | |
+ | |
-- | |
1.6.3.1 | |
From 9a4985fee0b4549a607f43d7a54a0b6e0d5e5889 Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Mon, 29 Jun 2009 03:50:28 -0500 | |
Subject: [PATCH 03/11] Added LAtin class and initial test case set | |
--- | |
tests/la/first_conjugation.tests.rb | 1 - | |
1 files changed, 0 insertions(+), 1 deletions(-) | |
diff --git a/tests/la/first_conjugation.tests.rb b/tests/la/first_conjugation.tests.rb | |
index d3ba9a3..bd03295 100755 | |
--- a/tests/la/first_conjugation.tests.rb | |
+++ b/tests/la/first_conjugation.tests.rb | |
@@ -26,7 +26,6 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
assert_respond_to Linguistics::LA, :razzle | |
end | |
- | |
end | |
-- | |
1.6.3.1 | |
From 236e45536282a78890719e1da3b9b69db2531267 Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 10:41:38 -0500 | |
Subject: [PATCH 04/11] Added in libraries from LatinVerb. | |
Created preliminary skeleton test classes. | |
inital work on first_conjugation test. | |
--- | |
lib/linguistics/la.rb | 3 + | |
lib/linguistics/la/LatinConjugation.rb | 619 +++++++++++++++++++++++++ | |
lib/linguistics/la/LatinDisplay.rb | 152 ++++++ | |
lib/linguistics/la/LatinIRB.rb | 279 +++++++++++ | |
lib/linguistics/la/LatinNode.rb | 54 +++ | |
lib/linguistics/la/LatinTense.rb | 96 ++++ | |
lib/linguistics/la/LatinVerb.rb | 550 ++++++++++++++++++++++ | |
lib/linguistics/la/LatinWord.rb | 158 +++++++ | |
lib/linguistics/language/MacronConversions.rb | 227 +++++++++ | |
lib/linguistics/language/TenseBlock.rb | 156 +++++++ | |
lib/linguistics/unicode/SGHUnicode.rb | 247 ++++++++++ | |
tests/la/first_conjugation.tests.rb | 180 +++++++ | |
tests/la/fourth_conjugation.tests.rb | 32 ++ | |
tests/la/second_conjugation.tests.rb | 32 ++ | |
tests/la/third-io_conjugation.tests.rb | 32 ++ | |
tests/la/third_conjugation.tests.rb | 32 ++ | |
16 files changed, 2849 insertions(+), 0 deletions(-) | |
create mode 100644 lib/linguistics/la/LatinConjugation.rb | |
create mode 100644 lib/linguistics/la/LatinDisplay.rb | |
create mode 100644 lib/linguistics/la/LatinIRB.rb | |
create mode 100644 lib/linguistics/la/LatinNode.rb | |
create mode 100644 lib/linguistics/la/LatinTense.rb | |
create mode 100644 lib/linguistics/la/LatinVerb.rb | |
create mode 100644 lib/linguistics/la/LatinWord.rb | |
create mode 100644 lib/linguistics/language/MacronConversions.rb | |
create mode 100644 lib/linguistics/language/TenseBlock.rb | |
create mode 100644 lib/linguistics/unicode/SGHUnicode.rb | |
create mode 100755 tests/la/fourth_conjugation.tests.rb | |
create mode 100755 tests/la/second_conjugation.tests.rb | |
create mode 100755 tests/la/third-io_conjugation.tests.rb | |
create mode 100755 tests/la/third_conjugation.tests.rb | |
diff --git a/lib/linguistics/la.rb b/lib/linguistics/la.rb | |
index eeb15a5..65e4025 100644 | |
--- a/lib/linguistics/la.rb | |
+++ b/lib/linguistics/la.rb | |
@@ -13,6 +13,9 @@ module Linguistics::LA | |
Linguistics::DefaultLanguages << :la | |
+ # Load in the secondary modules and add them to Linguistics::EN. | |
+ require 'linguistics/la/' | |
+ | |
############### | |
module_function | |
############### | |
diff --git a/lib/linguistics/la/LatinConjugation.rb b/lib/linguistics/la/LatinConjugation.rb | |
new file mode 100644 | |
index 0000000..f26e89f | |
--- /dev/null | |
+++ b/lib/linguistics/la/LatinConjugation.rb | |
@@ -0,0 +1,619 @@ | |
+=begin rdoc | |
+ | |
+==DESCRIPTION | |
+ | |
+This is a method for storing the heuristics which are required to conjugate Latin verbs. | |
+ | |
+The methods are named in a voice_mood_tense vector ( e.g. active_indicative_present). | |
+ | |
+Class variables are used to allow speedy iteration thanks to Ruby's fantastic iterators. | |
+ | |
+Within the document I include references to the Wheelock chapter in which the structure | |
+is mentioned. The page references I cite are from the 6th Edition, Revised. | |
+ | |
+==AUTHOR | |
+ | |
+Steven G. Harms ( http://www.stevengharms.com) | |
+ | |
+=end | |
+ | |
+module Latin | |
+ module Conjugation | |
+ | |
+ ############################################################################### | |
+ # Endings as module variables | |
+ ############################################################################### | |
+ | |
+ # active_present_endings: ("ap_"-prefixed) | |
+ @@ap_first_and_second_conjug_pers_endings = %w(s t mus tis nt) | |
+ @@ap_third_conjug_pers_endings = %w(o is it imus itis unt) | |
+ @@ap_thirdIO_conjg_pers_endings = %w(is it imus itis iunt) | |
+ | |
+ # active_imperfect_endings: ("ai_"-prefixed) | |
+ @@ai_first_and_second_conjug_pers_endings = %w(bam bās bat bāmus bātis bant) | |
+ @@ai_third_conjug_pers_endings = %w(ēbam ēbās ēbat ēbāmus ēbātis ēbant) | |
+ | |
+ # active_future_endings: ("af_"-prefixed) | |
+ @@af_one_two_endings = %w(bō bis bit bimus bitis bunt) | |
+ @@af_other_endings = %w(am ēs et ēmus ētis ent) | |
+ | |
+ # active_perfect_present: ("aperf"-prefixed) | |
+ @@aperf_endings = %w(istī it imus istis ērunt) | |
+ @@aperf_past_endings = @@pluperf_endings = | |
+ %w(eram erās erat erāmus erātis erant) | |
+ @@aperf_future_endings = %w(erō eris erit erimus eritis erint) | |
+ | |
+ # passive endings | |
+ @@passive_endings_first_and_second_conjg = | |
+ %w(r ris tur mur minī ntur) | |
+ @@passive_endings_other = | |
+ %w(r eris itur imur iminī untur) | |
+ | |
+ @@pass_perf_present_endings = %w(sum es est sumus estis sunt) | |
+ @@pass_perf_past_endings = %w(eram erās erat erāmus erātis erant) | |
+ @@pass_perf_future_endings = %w(erō eris erit erimus eritis erint) | |
+ | |
+ @@pass_perf_subj_endings = %w(sim sis sit simus sitis sint) | |
+ @@pass_pluperf_past_endings = %w(essem essēs esset essēmus essētis essent) | |
+ | |
+ | |
+ # subjunctive tools | |
+ # hash for getting a verb's subjunctive stem | |
+ # based off the W[e] F[ea]r [A] L[ia]r mnemonic | |
+ @@active_present_subjunctive_endings = { | |
+ "1" => lambda { |x| return x + "ē" }, | |
+ "2" => lambda { |x| return x + "eā" }, | |
+ "3" => lambda { |x| return x + "ā" }, | |
+ "4" => lambda { |x| return x + "iā" }, | |
+ "3IO" => lambda { |x| return x + "iā" } | |
+ } | |
+ | |
+ ############################################################################### | |
+ # Present System | |
+ ############################################################################### | |
+ | |
+=begin rdoc | |
+ | |
+The canonical building block of learning to conjugate verbs in Latin. Take the present | |
+active infinitive, chop off the ending, and add the classic o,s,t,mus,tis,nt | |
+ | |
+Wheelock Reference, p. 4. | |
+ | |
+=end | |
+ def active_indicative_present | |
+ if @conjugation == "1" or | |
+ @conjugation == "2" | |
+ return [ @first_pers_singular, | |
+ @@ap_first_and_second_conjug_pers_endings.collect{ |ending| Latin::LatinWord.new(@stem + ending)} | |
+ ].flatten! | |
+ elsif @conjugation == "3" | |
+ return [ @@ap_third_conjug_pers_endings.collect{ |ending| Latin::LatinWord.new(stem + ending) } ].flatten! | |
+ elsif @conjugation == "3IO" or | |
+ @conjugation=="4" | |
+ return [ @first_pers_singular, | |
+ @@ap_thirdIO_conjg_pers_endings.collect{ |ending| Latin::LatinWord.new(stem + ending) } | |
+ ].flatten! | |
+ end | |
+ end | |
+ | |
+=begin rdoc | |
+ | |
+Imperfect: Habitual action in the past. The base + %w(bam bas bat bamus batis bant). | |
+ | |
+Wheelock Reference, p. 37. | |
+ | |
+=end | |
+ def active_indicative_imperfect | |
+ if @conjugation == "1" or @conjugation == "2" | |
+ return [@@ai_first_and_second_conjug_pers_endings.collect{|x| Latin::LatinWord.new(stem + x)}].flatten | |
+ end | |
+ if @conjugation == "3" | |
+ return [@@ai_third_conjug_pers_endings.collect{|x| Latin::LatinWord.new(stem + x)}].flatten | |
+ end | |
+ if @conjugation=="3IO" or @conjugation=="4" | |
+ [@@ai_third_conjug_pers_endings.collect do |x| | |
+ Latin::LatinWord.new(stem + "i" + x) end ].flatten! | |
+ end | |
+ end | |
+ | |
+ # Future action: Future action. The base + %w(bo bis bit bimus bitis bunt) | |
+ def active_indicative_future | |
+ if @conjugation == "1" or @conjugation=="2" | |
+ return [@@af_one_two_endings.collect{|x| Latin::LatinWord.new(stem + x)}].flatten | |
+ end | |
+ if @conjugation == "3" | |
+ return [@@af_other_endings.collect{|x| Latin::LatinWord.new(stem + x)}].flatten | |
+ end | |
+ if @conjugation == "3IO" or @conjugation == "4" | |
+ return [@@af_other_endings.collect{|x| Latin::LatinWord.new(stem + "i" + x)}].flatten | |
+ end | |
+ end | |
+ | |
+ # Convenience method to pull all of the present system methods | |
+ # and load their returns in an array | |
+ def present_system | |
+ storage = [] | |
+ | |
+ storage << active_voice_indicative_mood_present_tense | |
+ storage << active_voice_indicative_mood_imperfect_tense | |
+ storage << active_voice_indicative_mood_future_tense | |
+ | |
+ return storage | |
+ end | |
+ | |
+ ############################################################################### | |
+ # Perfect System | |
+ ############################################################################### | |
+ | |
+ # Action completed in the past | |
+ # p. 77 | |
+ | |
+ def active_indicative_perfect | |
+ substem = @first_pers_perf[0..-2] | |
+ return [@first_pers_perf.to_s, @@aperf_endings.collect{|x| substem+x.to_s}].flatten | |
+ end | |
+ | |
+ # Action completed in the past | |
+ # p. 77 | |
+ | |
+ def active_indicative_pastperfect | |
+ substem = @first_pers_perf[0..-2] | |
+ return [@@aperf_past_endings.collect{|x| substem+x}].flatten | |
+ end | |
+ | |
+ # Action completed in the past | |
+ # p. 77 | |
+ | |
+ def active_indicative_futureperfect | |
+ substem = @first_pers_perf[0..-2] | |
+ return [@@aperf_future_endings.collect{|x| substem+x}].flatten | |
+ end | |
+ | |
+ # Convenience method to pull all of the perfect system methods | |
+ # and load their returns in an array | |
+ def perfect_system | |
+ storage = [] | |
+ | |
+ storage << active_voice_indicative_mood_perfect_tense | |
+ storage << active_voice_indicative_mood_pastperfect_tense | |
+ storage << active_voice_indicative_mood_futureperfect_tense | |
+ | |
+ return storage | |
+ end | |
+ | |
+ def active_indicative | |
+ present_system | |
+ perfect_system | |
+ end | |
+ | |
+ ############################################################################### | |
+ # Present Passive System | |
+ ############################################################################### | |
+ | |
+ # Passive voice, present tense | |
+ # Wheelock, 117 | |
+ | |
+ def passive_indicative_present | |
+ if conjugation=="1" or conjugation=="2" | |
+ local_pe=@@passive_endings_first_and_second_conjg.clone | |
+ return [Latin::LatinWord.new(@first_pers_singular.to_s + "r"), | |
+ local_pe[1..-1].map{|x| Latin::LatinWord.new(@stem + x)}].flatten! | |
+ end | |
+ if conjugation=="3" | |
+ return [Latin::LatinWord.new(@first_pers_singular+"r"), | |
+ @@passive_endings_other[1..-1].map{|x| Latin::LatinWord.new(stem + x)}].flatten! | |
+ end | |
+ if @conjugation == "3IO" | |
+ base=stem+"i" | |
+ return [Latin::LatinWord.new(@first_pers_singular+"r"), | |
+ @@passive_endings_other[1..-2].map{|x| Latin::LatinWord.new(stem + x)}, | |
+ Latin::LatinWord.new(base+@@passive_endings_other[-1])].flatten! | |
+ end | |
+ if @conjugation=="4" | |
+ base=stem+"ī" | |
+ return [Latin::LatinWord.new(@first_pers_singular+"r"), | |
+ @@passive_endings_first_and_second_conjg[1..-2].map{|x| Latin::LatinWord.new(base + x)}, | |
+ Latin::LatinWord.new(base+@@passive_endings_other[-1])].flatten! | |
+ end | |
+ end | |
+ | |
+ # Passive voice, present tense | |
+ # Wheelock, 117 | |
+ | |
+ def passive_indicative_imperfect | |
+ if conjugation=="1" or conjugation=="2" | |
+ imperfect_stem = self.stem + "b\xc4\x81" | |
+ return @@passive_endings_first_and_second_conjg.map{|x| Latin::LatinWord.new(imperfect_stem+x)} | |
+ end | |
+ if conjugation=="3" | |
+ ministem=self.stem + "ēbā" | |
+ return @@passive_endings_first_and_second_conjg.map{|x| ministem + x} | |
+ end | |
+ if @conjugation == "3IO" or @conjugation=="4" | |
+ base=stem+"iēbā" | |
+ return [@@passive_endings_first_and_second_conjg.map{|x| base + x}].flatten! | |
+ end | |
+ end | |
+ | |
+ # Passive voice, present tense | |
+ # Wheelock, 117 | |
+ | |
+ def passive_indicative_future | |
+ if conjugation=="1" or conjugation=="2" | |
+ fp_stem=@stem+"bi" | |
+ standards = @@passive_endings_first_and_second_conjg[2..-1].map{|x| Latin::LatinWord.new(fp_stem + x)} | |
+ standards.pop | |
+ fp_stem.sub!(/.$/,'u') | |
+ return [Latin::LatinWord.new(@stem + "b\xc5\x8dr"), | |
+ Latin::LatinWord.new(@stem + "beris"), standards, fp_stem+@@passive_endings_first_and_second_conjg.last].flatten! | |
+ end | |
+ if conjugation == "3" | |
+ fp_stem=self.stem+"ē" | |
+ standards = @@passive_endings_first_and_second_conjg[1..-1].map{|x| Latin::LatinWord.new(fp_stem + x)} | |
+ return [Latin::LatinWord.new(@stem + "ar"), standards].flatten! | |
+ end | |
+ if @conjugation == "3IO" or @conjugation=="4" | |
+ ie_base=stem+"iē" | |
+ return [Latin::LatinWord.new(stem+"ia"+@@passive_endings_first_and_second_conjg[0]), | |
+ @@passive_endings_first_and_second_conjg[1..-1].map{|x| Latin::LatinWord.new(ie_base + x)}].flatten! | |
+ end | |
+ end | |
+ | |
+ def passive_present_system | |
+ storage = [] | |
+ | |
+ storage << passive_voice_indicative_mood_present_tense | |
+ storage << passive_voice_indicative_mood_imperfect_tense | |
+ storage << passive_voice_indicative_mood_future_tense | |
+ | |
+ return storage | |
+ end | |
+ | |
+ ############################################################################### | |
+ # Present Passive System | |
+ ############################################################################### | |
+ | |
+ # Action completed in the past | |
+ # Wheelock, p. 122 | |
+ | |
+ def passive_indicative_perfect | |
+ @@pass_perf_present_endings.map{ |helping_verb| Latin::LatinWord.new("#{pass_perf_part} #{helping_verb}" ) } | |
+ end | |
+ | |
+ # Action completed in the past | |
+ # Wheelock, p. 122 | |
+ | |
+ def passive_indicative_pastperfect | |
+ @@pass_perf_past_endings.map{ |helping_verb| Latin::LatinWord.new("#{pass_perf_part} #{helping_verb}" ) } | |
+ end | |
+ | |
+ # Action completed in the past | |
+ # Wheelock, p. 122 | |
+ | |
+ def passive_indicative_futureperfect | |
+ @@pass_perf_future_endings.map{ |helping_verb| Latin::LatinWord.new("#{pass_perf_part} #{helping_verb}" ) } | |
+ end | |
+ | |
+ def passive_perfect_system | |
+ storage = [] | |
+ | |
+ storage << passive_voice_indicative_mood_perfect_tense | |
+ storage << passive_voice_indicative_mood_pastperfect_tense | |
+ storage << passive_voice_indicative_mood_futureperfect_tense | |
+ | |
+ return storage | |
+ end | |
+ | |
+ def passive_indicative | |
+ present_system | |
+ perfect_system | |
+ end | |
+ | |
+ def indicative_mood | |
+ present_system | |
+ passive_present_system | |
+ perfect_system | |
+ passive_perfect_system | |
+ end | |
+ | |
+ ############################################################################### | |
+ # SUBJUNCTIVE MOOD | |
+ ############################################################################### | |
+ | |
+ # Active voice | |
+ # Wheelock p. 187 | |
+ | |
+ def active_subjunctive_present | |
+ if @conjugation =~ /^[12]/ | |
+ asp_base = @@active_present_subjunctive_endings[@conjugation].call(@stem[0..-2]) | |
+ return ['m', | |
+ @@ap_first_and_second_conjug_pers_endings].flatten!.map do |ending| | |
+ Latin::LatinWord.new(asp_base + ending) | |
+ end | |
+ elsif @conjugation =~ /^3/ or @conjugation =~ /^4/ | |
+ asp_base = @@active_present_subjunctive_endings[@conjugation].call(@stem[0..-1]) | |
+ return ['m', | |
+ @@ap_first_and_second_conjug_pers_endings].flatten!.map do |ending| | |
+ Latin::LatinWord.new(asp_base + ending) | |
+ end | |
+ else | |
+ return @@active_present_subjunctive_endings | |
+ end | |
+ end | |
+ | |
+ # Subjunctive mood, active voice, imperfect tense | |
+ # Wheelock: p. 194 | |
+ | |
+ def active_subjunctive_imperfect | |
+ ['m', @@ap_first_and_second_conjug_pers_endings].flatten!.map do |ending| | |
+ Latin::LatinWord.new(@pres_act_inf + ending) | |
+ end | |
+ end | |
+ | |
+ # Subjunctive perfect | |
+ # Wheelock 202 | |
+ | |
+ def active_subjunctive_perfect | |
+ asp_base = | |
+ Latin::LatinWord.new(first_pers_perf[0..first_pers_perf.length-2]) + | |
+ "erī" | |
+ return ['m', @@ap_first_and_second_conjug_pers_endings].flatten!.map do |ending| | |
+ Latin::LatinWord.new(asp_base + ending) | |
+ end | |
+ | |
+ end | |
+ | |
+ # Subjunctive perfect | |
+ # Wheelock 203 | |
+ | |
+ def active_subjunctive_pastperfect | |
+ asp_base = @first_pers_perf[0..@first_pers_perf.length-2] + "issē" | |
+ return ['m', @@ap_first_and_second_conjug_pers_endings].flatten!.map do |ending| | |
+ Latin::LatinWord.new(asp_base + ending) | |
+ end | |
+ end | |
+ | |
+ def active_subjunctive_system | |
+ storage = [] | |
+ | |
+ storage << active_voice_subjunctive_mood_present_tense | |
+ storage << active_voice_subjunctive_mood_imperfect_tense | |
+ storage << active_voice_subjunctive_mood_perfect_tense | |
+ storage << active_voice_subjunctive_mood_pastperfect_tense | |
+ | |
+ return storage | |
+ end | |
+ | |
+ # Passive voice | |
+ # Wheelock: p. 188 | |
+ def passive_subjunctive_present | |
+ if @conjugation == "1" or @conjugation == "2" | |
+ short_base = | |
+ @@active_present_subjunctive_endings[@conjugation].call(@stem[0..-2]) | |
+ return @@passive_endings_first_and_second_conjg.map do |ending| | |
+ Latin::LatinWord.new(short_base + ending) | |
+ end | |
+ elsif @conjugation =~ /^3/ | |
+ subjunctive_stem = @conjugation =~ /O$/i ? stem + "iā" : stem + "ā" | |
+ return @@passive_endings_first_and_second_conjg.map do |ending| | |
+ Latin::LatinWord.new(subjunctive_stem + ending) | |
+ end | |
+ elsif @conjugation =~ /^4/ | |
+ subjunctive_stem = stem + "iā" | |
+ return @@passive_endings_first_and_second_conjg.map do |ending| | |
+ Latin::LatinWord.new(subjunctive_stem + ending) | |
+ end | |
+ end | |
+ end | |
+ | |
+ # Wheelock: 194 | |
+ def passive_subjunctive_imperfect | |
+ base = Latin::LatinWord.new(@pres_act_inf.reverse).rest.reverse + "ē" | |
+ return @@passive_endings_first_and_second_conjg.map do |ending| | |
+ Latin::LatinWord.new(base + ending) | |
+ end | |
+ end | |
+ | |
+ # Wheelock: p. 203 | |
+ def passive_subjunctive_perfect | |
+ counter = -1 | |
+ @@pass_perf_subj_endings.map do |ending| | |
+ counter += 1 | |
+ counter <=2 ? "[ #{perfect_passive_participle} ]" + " #{ending}" : | |
+ "[ #{pluralize_participial_listing(perfect_passive_participle)} ]" + | |
+ " #{ending}" | |
+ end | |
+ end | |
+ | |
+ # Wheelock: p. 203 | |
+ def passive_subjunctive_pastperfect | |
+ counter = -1 | |
+ @@pass_pluperf_past_endings.map do |ending| | |
+ counter += 1 | |
+ counter <=2 ? | |
+ "[ #{perfect_passive_participle} ]" + " " + ending : | |
+ "[ #{pluralize_participial_listing(perfect_passive_participle)} ]"+ | |
+ " " + ending | |
+ end | |
+ end | |
+ | |
+ def passive_subjunctive_system | |
+ storage = [] | |
+ | |
+ storage << passive_voice_subjunctive_mood_present_tense | |
+ storage << passive_voice_subjunctive_mood_imperfect_tense | |
+ storage << passive_voice_subjunctive_mood_perfect_tense | |
+ storage << passive_voice_subjunctive_mood_pastperfect_tense | |
+ | |
+ return storage | |
+ end | |
+ | |
+ | |
+ def subjunctive_mood | |
+ subjunctive_active | |
+ subjunctive_passive | |
+ end | |
+ | |
+ | |
+ ############################################################################### | |
+ # PARTICIPLES | |
+ ############################################################################### | |
+ | |
+ def present_active_participle | |
+ raise ("Bad nil") if @participial_stem.nil? | |
+ endings=%w(ns ntis) | |
+ return endings.collect{ |x| Latin::LatinWord.new(@participial_stem+x.chomp)}.join(', ') | |
+ end | |
+ | |
+ def future_active_participle | |
+ mybase=@pass_perf_part.gsub(/u[sm]$/, "ūr") | |
+ singular_endings=%w(us a um) | |
+ return singular_endings.collect{|x| Latin::LatinWord.new(mybase+"#{x}".chomp)}.join(', ') | |
+ | |
+ return base | |
+ end | |
+ | |
+ def perfect_passive_participle | |
+ mybase=@pass_perf_part.sub(/u[sm]$/,'') | |
+ singular_endings=%w(us a um) | |
+ return singular_endings.collect{|x| Latin::LatinWord.new(mybase+"#{x}".chomp)}.join(', ') | |
+ end | |
+ | |
+ def future_passive_participle | |
+ mybase = participial_stem+"nd" | |
+ singular_endings=%w(us a um) | |
+ return singular_endings.collect{|x| Latin::LatinWord.new(mybase+"#{x}".chomp)}.join(', ') | |
+ end | |
+ | |
+ def gerundive | |
+ self.future_passive_participle | |
+ end | |
+ | |
+ | |
+ def participles | |
+ @collections << { | |
+ 0 => ["Participles associated with:", definition_string], | |
+ 1 => ["Present Active Participle:" , present_active_participle], | |
+ 2 => ["Future Active Participle:" , future_active_participle], | |
+ 3 => ["Perfect Passive Participle" , perfect_passive_participle], | |
+ 4 => ["Future Passive Participle" , future_passive_participle] | |
+ } | |
+ return @collections.last | |
+ end | |
+ | |
+ ############################################################################### | |
+ # IMPERATIVES | |
+ ############################################################################### | |
+ | |
+ def imperatives | |
+ return_hash=[] | |
+ | |
+ imperative_exceptions = { | |
+ "ducere" => %w(duc ducite), | |
+ "dicere" => %w(dic dicite), | |
+ "facere" => %w(fac facite), | |
+ "ferre" => %w(fer ferte), | |
+ "nolere" => %w(nolo nolite) | |
+ } | |
+ | |
+ j = imperative_exceptions[@pres_act_inf].nil? ? | |
+ nil : | |
+ imperative_exceptions[@pres_act_inf] | |
+ | |
+ return j unless j.nil? | |
+ | |
+ if @pres_act_inf =~ /āre$/ | |
+ return_hash << [Latin::LatinWord.new(stem), Latin::LatinWord.new(stem+"te")] | |
+ end | |
+ if @pres_act_inf =~ /ēre$/ | |
+ return_hash << [ Latin::LatinWord.new(stem), Latin::LatinWord.new(stem+"te")] | |
+ end | |
+ if @pres_act_inf =~ /ere$/ | |
+ return_hash << [Latin::LatinWord.new(stem+"e"), Latin::LatinWord.new(stem+"ite")] | |
+ end | |
+ if @pres_act_inf =~ /īre$/ | |
+ return_hash << [Latin::LatinWord.new(stem+"ī"), Latin::LatinWord.new(stem+"īte")] | |
+ end | |
+ | |
+ @collections << return_hash.flatten! | |
+ return @collections.last | |
+ | |
+ end | |
+ | |
+ ############################################################################### | |
+ # INFINITIVES | |
+ ############################################################################### | |
+ def present_active_infinitive | |
+ return @pres_act_inf | |
+ end | |
+ | |
+ def perfect_active_infinitive | |
+ return @first_pers_perf+"sse" | |
+ end | |
+ | |
+ def future_active_infinitive | |
+ return future_active_participle.sub(/,.*/,'') + " esse" | |
+ end | |
+ | |
+ def present_passive_infinitive | |
+ if @conjugation == "1" | |
+ return @pres_act_inf.gsub(/(.*)e$/,"\\1\xc4\xab") | |
+ end | |
+ if @conjugation == "2" | |
+ return @pres_act_inf.gsub(/(.*)e$/,"\\1\xc4\xab") | |
+ end | |
+ if @conjugation == "3IO" | |
+ return @pres_act_inf.gsub(/(.*)ere$/,"\\1\xc4\xab") | |
+ end | |
+ if @conjugation == "3" | |
+ return @pres_act_inf.gsub(/(.*)ere$/,"\\1\xc4\xab") | |
+ end | |
+ if @conjugation == "4" | |
+ return @pres_act_inf.gsub(/(.*)e$/,"\\1\xc4\xab") | |
+ end | |
+ end | |
+ | |
+ def perfect_passive_infinitive | |
+ return perfect_passive_participle + " esse" | |
+ end | |
+ | |
+ # Returns a hash that's enumerated 0-5. Each one of those keys | |
+ # points to an array. The first element is a label, the second | |
+ # element is the node. | |
+ | |
+ def infinitives | |
+ @collections << { | |
+ 0 => ["Infinitives associated with:", definition_string ], | |
+ 1 => ["Present Active Infinitive:", present_active_infinitive], | |
+ 2 => ["Perfect Active Infinitive:", perfect_active_infinitive], | |
+ 3 => ["Future Active Infinitive:", future_active_infinitive], | |
+ 4 => ["Present Passive Infinitive", present_passive_infinitive], | |
+ 5 => ["Perfect Passive Infinitive", perfect_passive_infinitive] | |
+ } | |
+ return @collections.last | |
+ end | |
+ | |
+ # The big mamma-jamma, the one that loads up the verb in all phases and varieties | |
+ def full_conjugation | |
+ present_system | |
+ perfect_system | |
+ passive_present_system | |
+ passive_perfect_system | |
+ active_subjunctive_system | |
+ passive_subjunctive_system | |
+ imperatives | |
+ participles | |
+ infinitives | |
+ end | |
+ | |
+ private | |
+ | |
+ # The singular endings change from singular to plural | |
+ def pluralize_participial_listing(x) | |
+ x.sub!(/us,/, 'ī,' ) | |
+ x.sub!(/a,/, 'ae,') | |
+ x.sub!(/um.*$/, 'a' ) | |
+ end | |
+ end # end module Conjugation | |
+end # end module Latin | |
+# >> ############################################################################### | |
diff --git a/lib/linguistics/la/LatinDisplay.rb b/lib/linguistics/la/LatinDisplay.rb | |
new file mode 100644 | |
index 0000000..4f2f0a9 | |
--- /dev/null | |
+++ b/lib/linguistics/la/LatinDisplay.rb | |
@@ -0,0 +1,152 @@ | |
+# A mixin module for displaying LatinVerbs. Data created by Latin::LatinConjugation is created | |
+# and stored in @collections, an instance variable in a Latin::Latinverb. A full chart for the | |
+# verb can by had by using "chart_view". Other multiplex methods ("present_system" or | |
+# "perfect system" ) can be used to load up the @collections iVar ( which can be manipulated | |
+# as it is shared via attr_accessor) | |
+ | |
+module Latin | |
+ module Display | |
+ require 'pp' | |
+ | |
+=begin | |
+ | |
+Following stolen wholesale from: | |
+ | |
+http://www.ruby-forum.com/topic/134043 based on | |
+comments by Jordan Callicoat | |
+ | |
+pad is used to help "trick" printf under 1.8x into | |
+doing the right thing. In 1.9 this will not be necessary. | |
+ | |
+=end | |
+ | |
+ def pad(n,s) | |
+ shifter = (n - s.to_s.unpack("U*").length < 0) ? | |
+ 0 : | |
+ (n - s.to_s.unpack("U*").length) | |
+ | |
+ (" " * shifter ) + s.to_s | |
+ end | |
+ | |
+ # Padded is a method used to help trick a pseudo printf | |
+ # style of display when you have multibyte characters. | |
+ | |
+ def padded(*elems) | |
+ out = [] | |
+ for elem in elems.pop | |
+ out << pad(elem[0], elem[1]) | |
+ end | |
+ out.join(" ") | |
+ end | |
+ | |
+ | |
+=begin rdoc | |
+ | |
+Transform is used to take a series of horizontal arrays, and then put them | |
+into tuples in a 90 degree rotational transform. That is: | |
+ | |
+ [ [uno dos tres] [un deux trois] [een twee drie] [unus duo tres] ] | |
+ | |
+into | |
+ | |
+ [ [uno un een unus] [dos deux twee duo] [tres trois drie tres] ] | |
+ | |
+It returns this transformed array as an array, just as what came in. | |
+ | |
+=end | |
+ | |
+ def transform(m) | |
+ matrix_width = m[0].length | |
+ matrix_height = m.length | |
+ m.each do |row| | |
+ raise("Matrix was not square") unless (row.length == matrix_width) | |
+ end | |
+ | |
+ matrix_width -= 1 | |
+ matrix_height -= 1 | |
+ | |
+ new_matrix = [] | |
+ | |
+ 0.upto(matrix_width) do |column_position| | |
+ tuple = [] | |
+ 0.upto(matrix_height) do |horizontal_position| | |
+ tuple << m[horizontal_position][column_position] | |
+ end | |
+ new_matrix << tuple | |
+ end | |
+ return new_matrix | |
+ end | |
+ | |
+=begin rdoc | |
+ | |
+A display method that uses Latin::LatinConjugation.full_listing to get a | |
+data structure that is iterated through to produce a full chart layout. | |
+ | |
+=end | |
+ | |
+ def display_full_listing | |
+ puts " " * 15 + "Full Listing: #{@four_pp.join(', ')}" | |
+ | |
+ layout =[ [ "Present System", 0..2 ], | |
+ [ "Perfect System", 3..5 ], | |
+ [ "Present Passive System", 6..8 ], | |
+ [ "Perfect Passive System", 9..11 ], | |
+ [ "Subjunctive Active System", 12..15 ], | |
+ [ "Subjunctive Perfect Active", 16..19 ] ] | |
+ | |
+ layout.each do |layout_pair| | |
+ print "#{layout_pair[0]}\n" | |
+ d_f_display_block(transform(@collections[layout_pair[1]].map{ |row| row.nodes})) | |
+ print "\n\n" | |
+ end | |
+ | |
+ puts "Imperatives" | |
+ puts @collections[20] | |
+ print "\n\n" | |
+ | |
+ | |
+ @collections[21..22].each do |hash_struct| | |
+ 0.upto(hash_struct.keys.length-1) do |ctr| | |
+ puts hash_struct[ctr] | |
+ print "\n" | |
+ end | |
+ print "\n" * 2 | |
+ end | |
+ | |
+ @collections = [] | |
+ | |
+ end # end method display_full_listing | |
+ | |
+ # A method for displaying a LatinVerb's "queue" of things to display. It also | |
+ # flushes the @collections variable after execution, hence the "!". LatinVerb's | |
+ # to_s method is a redirect to this command. This allows us to stack multiple | |
+ # lookup commands to single display. | |
+ def display!(join_character) | |
+ puts @collections.join(join_character) | |
+ @collections = [] | |
+ end | |
+ | |
+ # A convenience method used to load up the display collection | |
+ # and then to call display_full listing to create a chart. | |
+ def chart_display | |
+ self.full_conjugation | |
+ self.display_full_listing | |
+ | |
+ end | |
+ | |
+ private | |
+ | |
+ def d_f_display_block(block) | |
+ labels = [ "1st sg.", " 2nd sg.", "3rd sg.", | |
+ "1st pl.", "2nd pl.", "3rd pl."] | |
+ | |
+ block.each_with_index do |tuple,i| | |
+ row = [labels[i]] + tuple | |
+ | |
+ puts padded(row.map{|item| [ 15 ,item]}) | |
+ end | |
+ | |
+ end | |
+ | |
+ end # end Display module | |
+end # End Latin | |
\ No newline at end of file | |
diff --git a/lib/linguistics/la/LatinIRB.rb b/lib/linguistics/la/LatinIRB.rb | |
new file mode 100644 | |
index 0000000..2ca71ba | |
--- /dev/null | |
+++ b/lib/linguistics/la/LatinIRB.rb | |
@@ -0,0 +1,279 @@ | |
+#!/usr/bin/env ruby | |
+ | |
+=begin rdoc | |
+ | |
+== Synopsis | |
+ | |
+LatinIRB: An IRB-based environment for working with Latin::LatinVerbs items. LatinIRB | |
+provides a space for command-line based exploration of Latin Verbs following into the | |
+find standard paradigms described by Wheelock as: 1st, 2nd, 3rd, 3rd-"IO", and 4th conjugations. | |
+ | |
+Upon opening the script, the student may play with verbs offered for exploration. These are the standard: | |
+ | |
+ Varible : Parts : meaning | |
+ * LatinVerb. : amō amāre amāvī amatum : to love / like | |
+ * @aSecond : moneō monēre monvī monitum : to warn / advise | |
+ * @aThird : agō agere ēgī actum : to do / lead / undertake | |
+ * @aThirdIO : capiō capere cēpī captum : to grab / seize | |
+ * @aFourth : audiō audīre audīvī auditum : to hear | |
+ | |
+== Usage | |
+ | |
+./LatinIRB | |
+ | |
+== Viewing | |
+ | |
+The environment takes advantage of Ruby's UTF-8 support to display the verbs with macrons ( notation representing | |
+tho quantity of the vowels ). I recommend that you use urxvt ( what I use ) or Apple's Terminal.app for | |
+viewing these entries. | |
+ | |
+== Macrons | |
+ | |
+As mentioned above, to help in pronunciation, the LatinIRB, and the Latin:: module that provides its functions, | |
+is macron aware. Provided it is given macrons in the initialization ( see below ) it knows when to shorten | |
+the macron and when to preserve it. Character palette access for these glyphs is annoying. Looking to | |
+LaTeX I found an ASCII-based standard for macron entry and provide it here for use in entry. | |
+ | |
+The array of four principle parts can be gained by issuing the following: | |
+ | |
+ MacronConverter.new('\={e}duc\={o} \={e}duc\={a}re \={e}duc\={a}v\={\i} \={e}ducatus') | |
+ | |
+This can be passed to the LatinVerb constructor ( see below ) | |
+ | |
+== Generating Verbs | |
+ | |
+Typically, in the code I have used the macron-ized character because Textmate and my Terminal of choice | |
+both understand it. | |
+ | |
+ LatinVerb.new %w(amō amāre amāvī amatum) | |
+ | |
+another way is: | |
+ | |
+ converted_metachar=MacronConverter.new('\={e}duc\={o} \={e}duc\={a}re \={e}duc\={a}v\={\i} \={e}ducatus') | |
+ anLV=LatinVerb.new(converted_metachar.to_a) | |
+ | |
+Thereafter you can execute : | |
+ anLV.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number #=> [ ēducatī, ēducatae, ēducata ] essēmus | |
+ | |
+== Executing Methods | |
+ | |
+Every verb in latin is a "vector" comprised of the voice / mood / tense / number / and person | |
+ | |
+=== Chart View | |
+ | |
+To view the chart of a verb, use LatinVerb.chart_display. This is a basic chart that will | |
+look familiar to students. | |
+ | |
+=== Singular Vector | |
+ | |
+As such methods are of the form | |
+ | |
+ (active|passive)_voice_(indicative|subjunctive)_mood_(present|imperfect|perfect|pastperfect|futureperfect|etc.)tense_first_person_singular_number | |
+ | |
+This will return a single value. Where the result is ambiguous ( e.g. 'number' is not provided ) multiple values are returned. | |
+an exhaustive list of options follows below. | |
+ | |
+=== Multiplex Vectors | |
+ | |
+Several convenience methods exist which load multiple tenses at the same time such as "present system" or "perfect system". These | |
+methods load the tenses into the @collections iVar associated with the LatinVerb. This value can be accessed as @collections | |
+is shared per attr_reader | |
+ | |
+=== Chart View | |
+ | |
+By using the LatinDisplay.chart_view, a chart, much like what is found in verb references can be had for the verb. This is a | |
+_very_ handy method. | |
+ | |
+=== Comprehensive List of Singular Vectors | |
+ | |
+ * LatinVerb.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ | |
+ * LatinVerb.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ * | |
+ * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ * LatinVerb.imperatives[0].to_s) | |
+ * LatinVerb.imperatives[1].to_s) | |
+ | |
+ * LatinVerb.present_active_participle ) | |
+ * LatinVerb.future_active_participle) | |
+ * LatinVerb.perfect_passive_participle) | |
+ * LatinVerb.future_passive_participle) | |
+ | |
+ * LatinVerb.present_active_infinitive.to_s) | |
+ * LatinVerb.perfect_active_infinitive) | |
+ * LatinVerb.future_active_infinitive) | |
+ * LatinVerb.present_passive_infinitive) | |
+ * LatinVerb.perfect_passive_infinitive) | |
+=end | |
+ | |
+require 'latin/LatinVerb' | |
+require 'language/MacronConversions' | |
+require 'irb' | |
+require 'irb/completion' | |
+ | |
+include MacronConversions | |
+include Latin | |
+ | |
+@aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
+@aSecond = Latin::LatinVerb.new %w(moneō monēre monvī monitum) | |
+@aThird = Latin::LatinVerb.new %w(agō agere ēgī actum) | |
+@aThirdIO = Latin::LatinVerb.new %w(capiō capere cēpī captum) | |
+@aFourth = Latin::LatinVerb.new %w(audiō audīre audīvī auditum) | |
+ | |
+IRB.start | |
+ | |
+=begin rdoc | |
+ | |
+== Conclusion | |
+ | |
+Enjoy and explore mundus latinae | |
+ | |
+== Author | |
+ | |
+Steven G. Harms ( [email protected] ) | |
+ | |
+== Thanks | |
+ | |
+Thanks to the Austin Ruby coders group who answered questions that helped me put this all together. Thanks also | |
+to the Reject^{2} conference at the Lone Star Ruby Conference 2008 who helped me think through some of the | |
+metaprogrammatic approaches. Thanks to Professor James Burleson of Austin Community College who insisted, | |
+old-style, of a mastery of the rote basics of Latin. Thanks also to Lauren Roth ( http://www.laurennroth.com) | |
+for her support and encouragement and understanding of my pre-dawn hack sessions. | |
+ | |
+=end | |
diff --git a/lib/linguistics/la/LatinNode.rb b/lib/linguistics/la/LatinNode.rb | |
new file mode 100644 | |
index 0000000..d8aeb91 | |
--- /dev/null | |
+++ b/lib/linguistics/la/LatinNode.rb | |
@@ -0,0 +1,54 @@ | |
+=begin rdoc | |
+ | |
+ | |
+==DESCRIPTION | |
+ | |
+Instead of simply storing a calculated node as a String ( or, better yet, as a Latin::LatinWord), | |
+Latin::LatinNode serves as a structure for holding the meta-information about the node ( its | |
+particular vector, i.e. @label ) as well as the actual value (@value). | |
+ | |
+==AUTHOR | |
+ | |
+Steven G. Harms ( http://www.stevengharms.com) | |
+ | |
+=end | |
+ | |
+module Latin | |
+ class LatinNode < Object | |
+ | |
+ attr_reader :label, :value | |
+ attr_accessor :display | |
+ | |
+=begin rdoc | |
+ | |
+Initialize with the metaprogrammatic value (label), the actual value of the node (value), | |
+and optionally a hash that contains a value for the key :display. This will specify whether, | |
+when to_s is called, if only the label, only the node, or both are displayed. The default | |
+is node-only | |
+ | |
+=end | |
+ | |
+ def initialize(label,value,*params) | |
+ @label,@value = label, value | |
+ @display = params[0][:display].nil? ? "all" : params[0][:display] | |
+ end | |
+ | |
+=begin rdoc | |
+ | |
+Print out the node, the node and label, or just the label based on the value | |
+of @display. See constructor for furhter details | |
+ | |
+=end | |
+ | |
+ def to_s | |
+ if @display == "all" or @display.nil? | |
+ return [label, value.to_s].join(':') | |
+ elsif @display == 'labelsonly' | |
+ return label | |
+ elsif @display == 'valuesonly' | |
+ return value.to_s | |
+ end | |
+ end | |
+ | |
+ end | |
+end | |
\ No newline at end of file | |
diff --git a/lib/linguistics/la/LatinTense.rb b/lib/linguistics/la/LatinTense.rb | |
new file mode 100644 | |
index 0000000..da93606 | |
--- /dev/null | |
+++ b/lib/linguistics/la/LatinTense.rb | |
@@ -0,0 +1,96 @@ | |
+=begin rdoc | |
+ | |
+==DESCRIPTION | |
+ | |
+This is a method for storing collections of Latin::LatinNode(s) | |
+ | |
+==AUTHOR | |
+ | |
+Steven G. Harms ( http://www.stevengharms.com) | |
+=end | |
+module Latin | |
+ class LatinTense < Object | |
+ | |
+=begin rdoc | |
+ | |
+@verb_methods contains the metaprogrammatic methods that are called | |
+to create each of the nodes in the LatinTense. The nodes, | |
+in order received, are stored in @aggregate_nodes. Lastly, the | |
+original label ( passed as part of the constructor ) is stored | |
+in @lobel | |
+ | |
+=end | |
+ | |
+ attr_reader :verb_methods, :aggregate_nodes, :label | |
+ | |
+=begin rdoc | |
+ | |
+Provided a label ( which defines the tense ) of the form "present" or | |
+imperfect, etc. and an array of nodes, a meta-structure, the | |
+Latin::LatinTense object is constructed. | |
+ | |
+ | |
+=end | |
+ | |
+ def initialize(label, array_of_latinNodes) | |
+ @label = label | |
+ @verb_methods = [] | |
+ @aggregate_nodes = [] | |
+ | |
+ # Create methods for accessing each of the particular nodes | |
+ | |
+ array_of_latinNodes.each do |node| | |
+ # Create a string by which we will name a method accessor of | |
+ # the node | |
+ method_name = node.label.sub(/^.*tense_/,'') | |
+ | |
+ # For easy access of finding the added methods for access | |
+ verb_methods << method_name | |
+ | |
+ # Actually create the methods for accessing the values | |
+ self.class.send(:define_method, method_name) { @collections.pop unless @collections.nil?; return node.value } | |
+ | |
+ # Push the node values into an array, it should wind up like: | |
+ # [node1, node2, node3]. It's just for convenience, really. | |
+ @aggregate_nodes.push(node.value) | |
+ end | |
+ end | |
+ | |
+ # Converts the aggregate nodes into an array prefixed by the label. | |
+ def to_s | |
+ return_string = "#{@label}: " | |
+ @aggregate_nodes.each do |node| | |
+ return_string += "#{node}, " | |
+ end | |
+ return_string.gsub!(/,\s+$/, '') | |
+ return return_string | |
+ end | |
+ | |
+ # This method is provided in the case that a number is not | |
+ # provided but a person is. This will lead to an ambiguity. | |
+ # In the case of this ambiguity, we return both of the nodes. | |
+ | |
+ def method_missing(id,*args) | |
+ if id.to_s !~ /^\w+_number/ and | |
+ id.to_s =~ /person/ | |
+ %w(singular plural).map do |generatedNumber| | |
+ call_symbol = ("#{generatedNumber}" + id.to_s).to_sym | |
+ @verb_methods << call_symbol | |
+ @aggregate_nodes << self.send(call_symbol) | |
+ end | |
+ else | |
+ super(id) | |
+ end | |
+ end | |
+ | |
+ # Synonym lookup | |
+ def nodes | |
+ return @aggregate_nodes | |
+ end | |
+ | |
+ def length | |
+ @aggregate_nodes.length | |
+ end | |
+ | |
+ end | |
+end | |
\ No newline at end of file | |
diff --git a/lib/linguistics/la/LatinVerb.rb b/lib/linguistics/la/LatinVerb.rb | |
new file mode 100644 | |
index 0000000..bf65cce | |
--- /dev/null | |
+++ b/lib/linguistics/la/LatinVerb.rb | |
@@ -0,0 +1,550 @@ | |
+require 'unicode/SGHUnicode' | |
+require 'language/TenseBlock' | |
+require 'latin/LatinWord' | |
+require 'latin/LatinNode' | |
+require 'latin/LatinConjugation' | |
+require 'latin/LatinDisplay' | |
+require 'latin/LatinTense' | |
+ | |
+module Latin | |
+ | |
+=begin rdoc | |
+ | |
+== Description | |
+ | |
+LatinVerb is a class for turning a given 4-part string of: | |
+ | |
+ * active voice, present, first person singular: amō, or amo | |
+ * present, active infinitive: amāre, or amare | |
+ * present, perfect, first person singular: amāvī, or amavi | |
+ * perfect passive participle: amatum, or amatus | |
+ | |
+Into a fully-exploded, fully conjugated Latin verb ( like you would see in | |
+chart forms on Wikipedia et in locis alteriis. | |
+ | |
+These are traditionally given in Wheelock as: | |
+<tt>amō, amāre, amāvī, amatum</tt> | |
+ | |
+Philosophically, in this class, we keep attributes and methods which are | |
+used to define the meta-structure of the verb. The specific verb calls | |
+("Give me the present active participles" or "Give me the present tense | |
+active indicative class") are handled metaprogrammatically and held | |
+in Latin::LatinConjugation. | |
+ | |
+=end | |
+ | |
+ | |
+ class LatinVerb < Latin::LatinWord | |
+ include Latin::Conjugation | |
+ include Latin::Display | |
+=begin | |
+ | |
+Scalar, created during initialization | |
+These are iVar's pointing to the “four principal parts” of a Latin | |
+verb. | |
+ | |
+=end | |
+ | |
+ attr_reader :first_pers_singular, :pres_act_inf, | |
+ :first_pers_perf, :pass_perf_part, :conjugation | |
+ | |
+=begin | |
+ | |
+Conjugation state, set by metapgrogrammatically handling the method | |
+call. Latin verbs have voice, mood, tense, number, and person. The | |
+:voice, :mood, etc. iVars will trap this. The default mode | |
+use case is to return all number / person “nodes” in a given | |
+tense. As such, the number and person are not stored here as iVars. | |
+ | |
+=end | |
+ | |
+ attr_reader :voice, :mood, :tense, :number, :person | |
+ | |
+=begin | |
+ | |
+Here are iVars that are used in calculation of nodes. | |
+ | |
+Stem is a place to store the verb stem e.g. amare=>ama, dicere => dic | |
+Vector is the original method that's passed. As mentioned above, we | |
+take a metaprogrammatic approach to handling method calls to the | |
+object. @vector records the method call that is trapped by | |
+method_missing?(id,*opts) | |
+ | |
+Participal stem is used as the base for forming participles. | |
+ | |
+Response is stored. It is a hash | |
+with only one pair: the name of the collection accessed, and the block | |
+of nodes ( or a single node, if it has been defined in such an | |
+explicit fashion ) | |
+ | |
+Collections is is where the displayable payload is stored. | |
+ | |
+=end | |
+ | |
+ attr_reader :stem, :participial_stem, :vector, :response, | |
+ :collections | |
+ | |
+=begin | |
+ | |
+Array | |
+ | |
+Four_pp is an aray of the four principal parts ( headers on listings) | |
+ | |
+=end | |
+ | |
+ attr_reader :four_pp | |
+ | |
+=begin | |
+ | |
+############################################################################## | |
+METHOD DECLARATION | |
+############################################################################## | |
+ | |
+=end | |
+ | |
+=begin rdoc | |
+ | |
+<b>Arguments</b>: Array containing 4 principal parts | |
+ | |
+<b>Attribs Used</b>: N/A | |
+ | |
+<b>Attribs Set</b>: @four_pp, @first_pers_singular, @pres_act_inf, | |
+@first_pers_perf, @pass_perf_part, @four_pp, | |
+@voice_mood_matrix, @stem ( via #calculate_stem) | |
+ | |
+*Returns*: Instance of LatinVerb | |
+ | |
+*Purpose*: A LatinVerb is created by passing an array of the four principal | |
+parts that define a Latin Verb. Typically these are: They are defined in an array: | |
+<tt>amō amāre amāvī amatum</tt>. | |
+ | |
+=end | |
+ | |
+ def initialize(*params) | |
+ | |
+ # Creates an array of LatinWords for each of the passed-in parameters | |
+ # Each principal part is given its own iVar | |
+ | |
+ @four_pp = params[0].map { |a_principal_part| Latin::LatinWord.new(a_principal_part) } | |
+ | |
+ if @four_pp.length != 4 | |
+ deponent_handler if @four_pp[2] =~ /sum$/ | |
+ end | |
+ | |
+ irregular_handler(@four_pp[1]) | |
+ | |
+ | |
+ @first_pers_singular, @pres_act_inf, | |
+ @first_pers_perf, @pass_perf_part = @four_pp | |
+ | |
+ # Create a top-level matrix that defines active_indicative / | |
+ # passive_indicative, etc. | |
+ # | |
+ # ____________ | |
+ # | | X | Y | | |
+ # | 1 | a | b | | |
+ # | 2 | c | d | | |
+ # ------------- | |
+ # | |
+ # In this case we have “voice by mood” | |
+ | |
+ @voice_mood_matrix = TenseBlock.new( { | |
+ :boundaries => 'voice by mood', | |
+ :voice => %w(Active Passive), | |
+ :mood => %w(Indicative Subjunctive), | |
+ :tense => nil, | |
+ :default_p => lambda { | |
+ |x,y| "#{x.downcase}_voice_#{y.downcase}_mood" | |
+ } | |
+ } | |
+ ) | |
+ | |
+ # Given the 4 PP's, we can now derive the stem | |
+ @stem = Latin::LatinWord.new(calculate_stem) | |
+ | |
+ # Set my conjugation | |
+ @conjugation = evaluate_conjugation | |
+ | |
+ # Calculate participal stem | |
+ @participial_stem = Latin::LatinWord.new(calculate_participial_stem) | |
+ | |
+ # Where to store things to-be displayed | |
+ @collections = [] | |
+ | |
+ | |
+ end | |
+ | |
+=begin rdoc | |
+ | |
+*Arguments*: Unrecognized method call, optional arguments | |
+ | |
+<b>Attribs Used</b>: N/A | |
+ | |
+<b>Attribs Set</b>: @vector | |
+ | |
+*Returns*: Instance of LatinVerb | |
+ | |
+*Purpose*: The method calls to a verb object can vary in over 100 ways, as such, coding that many methods seemed painful. Accordingly, we trap the unknown method call, parse it, and set iVars. | |
+ | |
+Having identified the iVars, we are able to call a hash structure | |
+containing lambdas to do the appropriate processing based on the “vector” | |
+of voice, mood, tense, person, etc. | |
+ | |
+=end | |
+ def method_missing(id, *args) | |
+ # We expect that method calls will be made to the object in the form: | |
+ # V.active_voice_indicative_mood_present_tense. Instead of having to | |
+ # create all these methods, we will look for unknown methods containing | |
+ # the pattern _voice_ | |
+ | |
+ if id.to_s =~ /_voice_/ | |
+ | |
+ @vector = id.to_s | |
+ | |
+ # This assignation needs to be done each call to the metaprog. | |
+ # method because of the event that a verb was called for | |
+ # a tense vector, and then a node vector. The first instance's | |
+ # filling in of @number, @person will cause the second call to do | |
+ # the wrong thing | |
+ | |
+ @number = @person = nil | |
+ evaluate_method(id) | |
+ | |
+ # In the case that the instance has been used before to get | |
+ # a specific vector, then we want to clear it out | |
+ @collections=[] if not @person.nil? and not @collections.nil? | |
+ | |
+ generated_method = [@voice,@mood,@tense].join('_').to_sym | |
+ | |
+ raise("Method #{generated_method.to_} is not responded to!") unless | |
+ self.respond_to?(generated_method) | |
+ | |
+ raise ("FLAMING DETH: pass to handler method returned nothing!") if | |
+ self.send(generated_method.to_sym).nil? | |
+ | |
+ | |
+ @collections << | |
+ conjoin_nodes_with_labels( | |
+ self.send(generated_method), | |
+ TenseBlock.new( { | |
+ :boundaries => 'numbers by persons', | |
+ :numbers => %w(Singular Plural), | |
+ :persons => %w(First Second Third), | |
+ :tense => 'present', | |
+ } | |
+ ) | |
+ ) | |
+ else | |
+ super(id) | |
+ end | |
+ end | |
+ | |
+ def to_s | |
+ display!("\n") | |
+ end | |
+ | |
+ def definition_string | |
+ return @four_pp.join(', ').to_s | |
+ end | |
+=begin | |
+ | |
+############################################################################## | |
+# PRIVATE METHODS BELOW | |
+############################################################################## | |
+ | |
+=end | |
+ private | |
+ | |
+=begin rdoc | |
+ | |
+*Arguments*: None | |
+ | |
+*Attribs Used*: @pres_act_inf | |
+ | |
+*Attribs Set*: None | |
+ | |
+*Returns*: The “stem” of a Latin Verb | |
+ | |
+*Purpose*: Based on the present active infinitive, identify the “stem” and set the @stem iVar. | |
+The method also returns the stem value. | |
+ | |
+=end | |
+ | |
+ def calculate_stem | |
+ # For efficiency, if the iVar @stem is defined, don't go through this structure | |
+ | |
+ pres_act_inf = @pres_act_inf.to_s | |
+ | |
+ if pres_act_inf =~ /āre$/ | |
+ return pres_act_inf.gsub(/(.*)āre$/,'\\1ā') | |
+ end | |
+ if pres_act_inf =~ /ēre$/ | |
+ return pres_act_inf.gsub(/(.*)ēre$/,'\\1ē') | |
+ end | |
+ if pres_act_inf =~ /ere$/ | |
+ if @first_pers_singular =~ /io$/ | |
+ return pres_act_inf.gsub(/(.*)ere$/,'\\1') | |
+ else | |
+ return pres_act_inf.gsub(/(.*)ere$/,'\\1') | |
+ end | |
+ end | |
+ if pres_act_inf =~ /īre$/ | |
+ return pres_act_inf.gsub(/(.*)īre$/,'\\1') | |
+ end | |
+ end | |
+ | |
+=begin rdoc | |
+ | |
+ | |
+*Arguments*: None | |
+ | |
+*Attribs Used*: @pres_act_inf | |
+ | |
+*Attribs Set*: @conjugation | |
+ | |
+*Returns*: The “stem” of a Latin Verb | |
+ | |
+*Purpose*: Based on the present, active infinitive, decide on the conjugation. This method requires that the endings be macron-ized in order to differentiate between _ere_ ( 2nd conjugation ) and _ere_ ( 4th conjugation). It returns the value as a String: <tt>1</tt>, <tt>2</tt>, <tt>3</tt>, <tt>4</tt>, or <tt>3IO</tt> (e.g. <i>duco/ducere</i>) | |
+ | |
+=end | |
+ | |
+ def evaluate_conjugation | |
+ ending = @pres_act_inf.get_last_three_characters | |
+ returnValue = nil | |
+ | |
+ if ending =~ /āre$/ | |
+ returnValue = "1" | |
+ end | |
+ | |
+ if ending =~ /ēre$/ | |
+ returnValue = "2" | |
+ end | |
+ | |
+ if ending =~ /ere$/ | |
+ if @first_pers_singular.get_last_three_characters =~ /iō$/ | |
+ returnValue = "3IO" | |
+ else | |
+ returnValue = "3" | |
+ end | |
+ end | |
+ | |
+ if ending =~ /īre$/ | |
+ returnValue = "4" | |
+ end | |
+ | |
+ return returnValue | |
+ end | |
+ | |
+=begin rdoc | |
+ | |
+Calculate the participial stem, used in forming participles. | |
+ | |
+=end | |
+ | |
+ def calculate_participial_stem | |
+ raise("@pres_act_inf was nil!") if | |
+ @pres_act_inf.nil? or @first_pers_singular.nil? | |
+ | |
+ if @pres_act_inf.to_s =~ /(.*ā)re$/ | |
+ return $1 | |
+ end | |
+ | |
+ if @pres_act_inf.to_s =~ /(.*ē)re$/ | |
+ return $1 | |
+ end | |
+ | |
+ if @pres_act_inf.to_s =~ /(.*)ere$/ | |
+ match=$1 | |
+ if @first_pers_singular =~ /iō/ | |
+ return match + "iē" | |
+ else | |
+ return match + "e" | |
+ end | |
+ end | |
+ | |
+ if @pres_act_inf.to_s =~ /(.*)īre$/ | |
+ return $1 + "iē" | |
+ end | |
+ end | |
+ | |
+ | |
+=begin | |
+ | |
+This is used to print out a full vector's nodes. The value | |
+of @vector is used as a title. The nodes that were produced | |
+by means of the lambda are then printed out. | |
+ | |
+=end | |
+ | |
+ def conjoin_nodes_with_labels(nodes,labels) | |
+ raise "conjoin_nodes failed to receieve a node or label set" if | |
+ nodes.nil? or labels.nil? | |
+ paired_node_array=[] | |
+ | |
+ 0.upto(labels.length-1) do |i| | |
+ paired_node_array.push(Latin::LatinNode.new(labels.matrix[i], | |
+ nodes[i], {:displayable => 'valuesonly'}) ) | |
+ end | |
+ | |
+ tense_label = @vector.capitalize!.split(/_/).join(' ') | |
+ | |
+ full_tense = Latin::LatinTense.new(tense_label, paired_node_array) | |
+ | |
+ if @person.nil? and @number.nil? # For handling ...present_tense | |
+ return full_tense | |
+ elsif @number.nil? and not @person.nil? # number not defined; person yes | |
+ | |
+ # Find the methods that match the parameter that we were given | |
+ matching_methods = | |
+ full_tense.verb_methods.map {|x| x if x =~ /#{@person}/}.compact! | |
+ | |
+ # Call those methods and store the result to an array | |
+ ambiguous_results = | |
+ matching_methods.map{|aMethod| full_tense.send(aMethod.to_sym)} | |
+ | |
+ # Return it | |
+ return ambiguous_results.join(", ") | |
+ elsif not @number.nil? and @person.nil? | |
+ # This guy is really just the inverse of the above. | |
+ | |
+ # Find the methods that match the parameter that we were given | |
+ matching_methods = | |
+ full_tense.verb_methods.map {|x| x if x =~ /#{@number}/}.compact! | |
+ | |
+ # Call those methods and store the result to an array | |
+ ambiguous_results = | |
+ matching_methods.map{|aMethod| full_tense.send(aMethod.to_sym)} | |
+ | |
+ # Return it | |
+ return ambiguous_results.join(", ") | |
+ | |
+ elsif not @number.nil? and not @person.nil? # fully specified node | |
+ locate_string = [@number,'number',@person,'person',].join('_') | |
+ return full_tense.send(locate_string.to_sym) | |
+ end | |
+ | |
+ end | |
+ | |
+ # This method is used internally to evaluate a method call that looks like | |
+ # a request for a conjugation. The first descriptor pair is chopped off | |
+ # from the given 'name' and the rest is held. The given is sent through | |
+ # is recognized? where, if valid, an iVar is set. | |
+ # | |
+ # e.g. active_voice performs @voice=active | |
+ # | |
+ # Failure to successfully classify raises an exception | |
+ # | |
+ # If there is anything left in 'rest', then the function is recursively | |
+ # called with 'rest'. | |
+ # | |
+ | |
+ def evaluate_method(name) | |
+ command = name.to_s.match(/(\w+?_){2}/).to_s | |
+ rest = name.to_s[command.to_s.length..name.to_s.length] | |
+ | |
+ # If you're at the last term, command does not get loaded | |
+ # but rest stays the same. | |
+ if command !~ /\w/ and name == rest | |
+ command = rest | |
+ rest = nil | |
+ end | |
+ | |
+ # We've reached the end | |
+ return if command !~ /\w/ and rest !~ /\w/ | |
+ | |
+ # Recurse | |
+ evaluate_method(rest) if is_recognized?(command) | |
+ | |
+ end | |
+ | |
+ # Given a string of the form "active_voice" ( or a "value/term" pair ) | |
+ # test its validity by Object.send(term.to_sym, value). | |
+ | |
+ def is_recognized?(datum) | |
+ value, term = datum.split(/_/) | |
+ term = "calculate_" + term | |
+ send(term.to_sym, value) | |
+ | |
+ # Return true, because the 'send' call did not throw an exception | |
+ return true | |
+ end | |
+ | |
+ # Used to set the voice iVar OR raise an exception | |
+ def calculate_voice(param) | |
+ if param =~ /^(active|passive)$/i | |
+ @voice = param | |
+ return | |
+ end | |
+ raise "Unknown voice: #{param.to_s}, called." | |
+ end | |
+ | |
+ # Used to set the voice iVar OR raise an exception | |
+ def calculate_mood(param) | |
+ param.gsub!(/\W/, '') | |
+ if param =~ /(indicative|subjunctive)/i | |
+ @mood = param.downcase | |
+ return | |
+ end | |
+ raise "Unknown mood: #{param.to_s}, called" | |
+ end | |
+ | |
+ # Used to set the voice iVar OR raise an exception | |
+ def calculate_tense(param) | |
+ param.downcase! | |
+ if @mood == "indicative" | |
+ # All the legitimate moods in the indicative | |
+ if param == "present" or | |
+ param == "imperfect" or | |
+ param == "future" or | |
+ param == "perfect" or | |
+ param == "pluperfect" or | |
+ param == "pastperfect" or | |
+ param == "futureperfect" | |
+ @tense = param | |
+ end | |
+ elsif @mood == "subjunctive" | |
+ # All the legitimate moods in the subjunctive | |
+ if param == "present" or | |
+ param == "imperfect" or | |
+ param == "perfect" or | |
+ param == "pluperfect" or | |
+ param == "pastperfect" | |
+ @tense = param | |
+ end | |
+ else | |
+ raise "Tense [#{param}] was found to be invalid." | |
+ end | |
+ end | |
+ | |
+ def calculate_person(param) | |
+ @person = param.downcase | |
+ end | |
+ | |
+ def calculate_number(param) | |
+ @number = param.downcase | |
+ end | |
+ | |
+ def deponent_handler | |
+ raise "Sorry, we do not handle (semi-) deponent verbs at this time. It's on the TODO list, thought!" | |
+ end | |
+ | |
+ def irregular_handler(test_infinitive) | |
+ if %w(esse nōlle).find{|irregular| test_infinitive.to_s == irregular} | |
+ raise "Sorry, we do not handle irregular verbs at this time. It's on the TODO list, thought!" | |
+ end | |
+ end | |
+ end # ends the class | |
+ | |
+=begin rdoc | |
+ | |
+ == Dependencies | |
+ | |
+ None | |
+ | |
+ == Author | |
+ | |
+ Steven G. Harms, http://www.stevengharms.com | |
+ | |
+=end | |
+end | |
+ | |
diff --git a/lib/linguistics/la/LatinWord.rb b/lib/linguistics/la/LatinWord.rb | |
new file mode 100644 | |
index 0000000..5b19089 | |
--- /dev/null | |
+++ b/lib/linguistics/la/LatinWord.rb | |
@@ -0,0 +1,158 @@ | |
+# == Synopsis | |
+# | |
+# Latin : A module for dealing with textual issues around manipulation of strings containing Latin words | |
+# | |
+# == Usage | |
+# | |
+# load 'latin/LatinSting.rb' | |
+# | |
+# == Description | |
+# | |
+# The class provides the class LatinString. | |
+# | |
+# == Example Code | |
+# | |
+# load 'language/MacronConversions.rb' | |
+# | |
+# == Inherits From | |
+# | |
+# SGHUnicode::UnicodeSafeString | |
+# | |
+# == Dependencies | |
+# | |
+# None | |
+# | |
+# == Author | |
+# | |
+# Steven G. Harms, http://www.stevengharms.com | |
+# | |
+ | |
+require 'unicode/SGHUnicode' | |
+ | |
+module Latin | |
+ class LatinWord < SGHUnicode::UnicodeSafeString | |
+ | |
+ @@macron_table = {"\xc4\x81" => 'a', | |
+ "\xc4\x93" => 'e', | |
+ "\xc4\xab" => 'i', | |
+ "\xc5\x8d" => 'o', | |
+ "\xc5\xab" => 'u', | |
+ "\xc4\x80" => 'A', | |
+ "\xc4\x92" => 'E', | |
+ "\xc4\xaa" => 'I', | |
+ "\xc5\x8c" => 'O', | |
+ "\xc5\xaa" => 'U', | |
+ } | |
+ | |
+ attr_reader :ending | |
+ | |
+ def initialize(*construct) | |
+ super(*construct) | |
+ fix_macrons! | |
+ end | |
+ | |
+ # Gets the last three characters of a latinWord. This is useful | |
+ # when evaluating the endings of verbs. | |
+ | |
+ def get_last_three_characters(mode=:string, *aString) | |
+ source_array=to_a[-3,3] | |
+ if mode.to_sym == :string | |
+ return source_array.to_s | |
+ elsif mode.to_sym == :array | |
+ return source_array | |
+ end | |
+ end | |
+ | |
+ # This “fixes” the macrons in a string as defined in Wheelock's | |
+ # introduction. Per the text there are three occasions where the | |
+ # long sound of a macron must be shortened. | |
+ # | |
+ # Three rules: Long vowels are shortened when they are followed | |
+ # 1. by another vowel | |
+ # 2. by m/r/t at the end of a word | |
+ # 3. by nt or nd anywhere | |
+ | |
+ def fix_macrons! | |
+ # Get a mutable copy | |
+ mutator = Array.new(@sanitized_array) | |
+ | |
+ # Vowels | |
+ @sanitized_array.each_with_index do |e, i| | |
+ next if multibyte_locations[i] == 0 | |
+ if is_a_vowel(@sanitized_array[i+1]) | |
+ mutator[i] = @@macron_table[e] | |
+ end | |
+ end | |
+ | |
+ # m/r/t | |
+ if @sanitized_array.last =~ /[mrt]/ | |
+ unless @@macron_table[@sanitized_array[length-2]].nil? | |
+ mutator[length-2]=@@macron_table[mutator[length-2]] | |
+ end | |
+ end | |
+ | |
+ #n[td] | |
+ @sanitized_array.each_with_index do |e, i| | |
+ if e == "n" and | |
+ @sanitized_array[i+1] =~ /[td]/ and not | |
+ @@macron_table[@sanitized_array[i-1]].nil? | |
+ mutator[i-1]=@@macron_table[@sanitized_array[i-1]] | |
+ end | |
+ end | |
+ | |
+ evaluate_string(mutator.to_s) | |
+ end | |
+ | |
+ def unpack(pattern) | |
+ return @USS.unpack(pattern) | |
+ end | |
+ | |
+ def gsub(pattern, replacement) | |
+ return @USS.gsub(pattern, replacement) | |
+ end | |
+ | |
+ def sub(pattern, replacement) | |
+ return @USS.sub(pattern, replacement) | |
+ end | |
+ | |
+ def =~(pat) | |
+ return @USS.match(pat) | |
+ end | |
+ | |
+ def +(component) | |
+ return @USS + component | |
+ end | |
+ | |
+ def unpack(formatter) | |
+ return @USS.unpack(formatter) | |
+ end | |
+ | |
+ def sub!(pattern,replacement) | |
+ evaluate_string(@USS.sub(pattern,replacement)) | |
+ end | |
+ | |
+ def match(pattern) | |
+ return @USS.match(pattern) | |
+ end | |
+ | |
+ def to_s | |
+ return @USS | |
+ end | |
+ | |
+############################################################################## | |
+# PRIVATE METHODS | |
+############################################################################## | |
+ | |
+ private | |
+ | |
+ def is_a_vowel(c) | |
+ return true if c =~ /[aeiou]/i | |
+ return false if @@macron_table[c].nil? | |
+ return true if @@macron_table[c] != nil | |
+ return false | |
+ end | |
+ | |
+ | |
+ end | |
+end | |
+ | |
diff --git a/lib/linguistics/language/MacronConversions.rb b/lib/linguistics/language/MacronConversions.rb | |
new file mode 100644 | |
index 0000000..74ceb66 | |
--- /dev/null | |
+++ b/lib/linguistics/language/MacronConversions.rb | |
@@ -0,0 +1,227 @@ | |
+# == Synopsis | |
+# | |
+# MacronConversions: module providing classes to convert macron (dis-)enabled strings into the opposite. | |
+# | |
+# == Usage | |
+# | |
+# load 'language/MacronConversions.rb' | |
+# | |
+# == Description | |
+# | |
+# The class provides two classes: MacronConverter and MacronDeConverter. In the event that you need to transform LaTeX-style markep into entities of some | |
+# sort, use the former class. In the event that you need to down-sample macron-characters into LaTeX-style, use the latter. | |
+# | |
+# == Example Code | |
+# | |
+# load 'language/MacronConversions.rb' | |
+# | |
+# # Basic conversion and advanced conversion | |
+# | |
+# puts MacronConversions::MacronConverter.new("mon\\={e}re", 'mc') | |
+# puts MacronConversions::MacronConverter.new('to bring up, educate: \={e}duc\={o}, \={e}duc\={a}re, \={e}duc\={a}v\={\i}, \={e}ducatus; education, educator, educable', 'mc') | |
+# | |
+# # Vanilla de-conversion | |
+# puts MacronConversions::MacronDeConverter.new("vanilla") | |
+# | |
+# # Complex de-conversion | |
+# puts MacronConversions::MacronDeConverter.new("laudāre") | |
+# | |
+# # Coup de grace | |
+# puts MacronConversions::MacronDeConverter.new( | |
+# MacronConversions::MacronConverter.new('to bring up, educate: \={e}duc\={o}, \={e}duc\={a}re, \={e}duc\={a}v\={\i}, \={e}ducatus; education, educator, educable', 'mc').to_s) | |
+# | |
+# == Dependencies | |
+# | |
+# Requires the 'unicode/SGHUnicode' module | |
+# | |
+# == Author | |
+# | |
+# Steven G. Harms, http://www.stevengharms.com | |
+ | |
+module MacronConversions | |
+ require 'unicode/SGHUnicode' | |
+ | |
+ LATEX_TO_MACRONS_CHARACTERS = { | |
+ "\\={a}" => "ā", | |
+ "\\={e}" => "ē", | |
+ "\\={\\i}" => "ī", | |
+ "\\={o}" => "ō", | |
+ "\\={u}" => "ū", | |
+ "\\={A}" => "Ā", | |
+ "\\={E}" => "Ē", | |
+ "\\={\\I}" => "Ī", | |
+ "\\={O}" => "Ō", | |
+ "\\={U}" => "Ū", | |
+ } | |
+ | |
+ LATEX_TO_UTF8 ={ | |
+ "\\={a}" => "\\xc4\\x81", | |
+ "\\={e}" => "\\xc4\\x93", | |
+ "\\={\\i}" => "\\xc4\\xab", | |
+ "\\={o}" => "\\xc5\\x8d", | |
+ "\\={u}" => "\\xc5\\xab", | |
+ "\\={A}" => "\\xc4\\x80", | |
+ "\\={E}" => "\\xc4\\x92", | |
+ "\\={\\I}" => "\\xc4\\xaa", | |
+ "\\={O}" => "\\xc5\\x8c", | |
+ "\\={U}" => "\\xc5\\xaa", | |
+ } | |
+ | |
+ LATEX_TO_HTML_ENTITIES = { | |
+ "\\={a}" => "ā", | |
+ "\\={e}" => "ē", | |
+ "\\={\\i}" => "ī", | |
+ "\\={o}" => "ō", | |
+ "\\={u}" => "ū", | |
+ "\\={A}" => "Ā", | |
+ "\\={E}" => "Ē", | |
+ "\\={\\I}" => "Ī", | |
+ "\\={O}" => "Ō", | |
+ "\\={U}" => "Ū", | |
+ } | |
+ | |
+ class MacronConverter < Object | |
+ | |
+ attr_reader :convert | |
+ | |
+ # Initializer method expects to be provided a string to convert, and then one of three possible output | |
+ # types: high-numerical-code entities, UTF-8, and HTML entities. Absent | |
+ # any specification, output format will default to HTML numbered entities. | |
+ # | |
+ # MacronConverter.new(laud\={a}re) #-> laudāre | |
+ # | |
+ # MacronConverter.new(laud\={a}re, 'mc') #-> laudāre | |
+ | |
+ def initialize(orig_string, output_target='mc') | |
+ @orig_string = orig_string | |
+ @target = output_target | |
+ @convert = processString | |
+ end | |
+ | |
+ # This allows a MacronConverter object to be printed with "puts" | |
+ def to_s | |
+ return @convert | |
+ end | |
+ | |
+ def split(pattern) | |
+ return @convert.split(pattern) | |
+ end | |
+ | |
+ def to_a | |
+ return @convert.split(/\s+/) | |
+ end | |
+ | |
+############################################################################## | |
+# PRIVATE METHODS | |
+############################################################################## | |
+ | |
+ private | |
+ # Process string is the routine that scans a token for LaTeX macron codes. | |
+ # The method is recursive, the sentinel value is when the first RegEx scan | |
+ # of the string returns nil. Upon the indetification of a macron-ized | |
+ # character, it passes that character to the private method | |
+ # MacronConverter#processChar | |
+ | |
+ def processString(s=@orig_string) | |
+ # All LaTeX Macron codes begin with an '=' token. Scan for that using a | |
+ # RegEx. The value is set to firstSlash. | |
+ | |
+ firstSlash = s =~ /(\\=.*?\})/ | |
+ return s if $1.nil? | |
+ | |
+ testChar = $1 | |
+ | |
+ # In the event that the first character is macron-bearing follow this | |
+ # case. | |
+ if firstSlash == 0 | |
+ return processChar(testChar).to_s + | |
+ processString(s[firstSlash+testChar.length..s.length]) | |
+ end | |
+ | |
+ # In the more general case, we take the original string up to the first | |
+ # macron-beginning-slash. We return that + running processChar on the | |
+ # remainder of the string, that is return part_ok + | |
+ # processString(the_rest). | |
+ | |
+ return s[0..firstSlash-1] + processChar(testChar).to_s + | |
+ processString(s[firstSlash+testChar.length..s.length]) | |
+ end | |
+ | |
+ # Given a singular character, it does a hash-table lookup against the | |
+ # constant-defined LATEX_TO_UTF8 LATEX_TO_HTML_ENTITIES or | |
+ # LATEX_TO_MACRONS_CHARACTERS hashes and returns the value from the hash | |
+ | |
+ def processChar(c) | |
+ if @target == 'utf8' | |
+ return LATEX_TO_UTF8[c] | |
+ end | |
+ if @target == 'html' | |
+ return LATEX_TO_HTML_ENTITIES[c] | |
+ end | |
+ if @target == "mc" | |
+ return LATEX_TO_MACRONS_CHARACTERS[c] | |
+ end | |
+ end | |
+ end | |
+ | |
+ class MacronDeConverter | |
+ attr_reader :convert | |
+ | |
+ # In the construction, pass in the string that you wish to convert | |
+ # | |
+ # e.g. MacronDeConverter.new(laudāre means to praise) #-> laud\={a}re means to praise | |
+ def initialize(content="No Content Provided - Consult Documentation") | |
+ | |
+ test_string=SGHUnicode::UnicodeSafeString.new(content) | |
+ | |
+ if test_string =~ /\&\#/ | |
+ @target = 'LATEX_TO_HTML_ENTITIES' | |
+ elsif test_string =~ /[āēīōūĀĒĪŌŪ]/ | |
+ @target = 'LATEX_TO_MACRONS_CHARACTERS' | |
+ elsif test_string =~ /\\\\x/ | |
+ @target = 'LATEX_TO_UTF8' | |
+ else | |
+ @target = nil | |
+ end | |
+ | |
+ unless @target.nil? | |
+ @reference_table=eval("MacronConversions::#{@target}") | |
+ @reference_table.each{|x,y| @reference_table[y]=x} | |
+ @convert = processString(test_string) | |
+ else | |
+ @convert = test_string | |
+ end | |
+ end | |
+ | |
+ # This allows a MacronDeConverter object to be printed with "puts" | |
+ def to_s | |
+ return @convert | |
+ end | |
+ | |
+ private | |
+ | |
+ # Iterates through the characters, looking up the meta-descriptor | |
+ # characters were found | |
+ def processString(s) | |
+ unless s.nil? | |
+ unless s.rest.empty? | |
+ return processChar(s.first) + processString(s.rest) | |
+ else | |
+ return processChar(s.first) | |
+ end | |
+ end | |
+ end | |
+ | |
+ # Looks up the character in the selected lookup chart. Turns the | |
+ # meta descriptor character \={e} into the glyph. | |
+ | |
+ def processChar(c) | |
+ return @reference_table.key?(c) ? @reference_table[c] : c | |
+ end | |
+ | |
+ | |
+ end | |
+ | |
+end | |
+ | |
+ | |
diff --git a/lib/linguistics/language/TenseBlock.rb b/lib/linguistics/language/TenseBlock.rb | |
new file mode 100644 | |
index 0000000..a9ad25d | |
--- /dev/null | |
+++ b/lib/linguistics/language/TenseBlock.rb | |
@@ -0,0 +1,156 @@ | |
+=begin rdoc | |
+ | |
+== Synopsis | |
+ | |
+TenseBlock: module used to fabricate methods used for verb node construction | |
+ | |
+== Description | |
+ | |
+Generating all the methods associated with a full conjugation of a verb in Latin is exceedingly long. A verb can be classified as | |
+ | |
+ def active_voice | |
+ def indicative_mood | |
+ def simple_present_tense | |
+ def singular_number | |
+ def first_person | |
+ | |
+Recognizing this, we need a way to generate a listing of an atomic structure, a "tense matrix": foreach number, each person has a value. | |
+ | |
+By passing in a matrix description in natural language ( "person by number") default values which define | |
+the <i>n</i>-many "<tt>person</tt>S" and "<tt>number</tt>S" are expected. | |
+ | |
+Using a reasonable assumption that methods should be produced as | |
+ | |
+<tt>tense_parameter</tt>\_tense\_<tt>personValue</tt>\_person\_<tt>numberValue</tt>\_number, | |
+ | |
+we fabricate a matrix of method names. | |
+ | |
+This can be overridden by changing the lambda defined in initialization ( :default_p ) | |
+ | |
+This matrix can be accessed as an array through the TenseBlock#matrix method. | |
+ | |
+A listing of the the matrix values can be acquired via the TenseBlock.to_s method. | |
+ | |
+== Example Code | |
+ | |
+ j.to_s #=> array of all the names, create_matrix called implicitly | |
+ # as part of TenseBlock.new(). Default lambda used. | |
+ | |
+ # Iterate over the values that build the matrix of names | |
+ j.create_matrix(Optional: lambda to override :default_p{|x| puts x } | |
+ | |
+ # Override the default wrapping lambda | |
+ j.create_matrix( lambda { |x,y| "<<#{x}++#{y}>>" } ){|x| puts x } | |
+ | |
+== Author | |
+ | |
+Steven G. Harms, http://www.stevengharms.com | |
+ | |
+=end | |
+ | |
+class TenseBlock < Object | |
+ attr_reader :boundaries, :definition, :matrix | |
+ | |
+=begin rdoc | |
+ | |
+ Initialize expects an initializing hash. | |
+ | |
+ :<b>boundaries</b>:: Defines the breadth and height of the two-dimensional matrix | |
+ | |
+ :<b>default_p</b>:: As pairs in the matrix are established, an action is taken with them. The default action is described above. In the case that this should be overridden assign a lambda to this key ( see examples, above ). You may also gain dynamicity over these pairs by calling the TenseBlock#create_matrix method with a lambda passed as the single argument. | |
+ | |
+ :<b>tense</b>:: This value will be interpolated into a string "tenseValue_tense_" which will be _prepended_ to all value pairs that are output by the lambda in :default_p ( again, barring that that lambda is overridden as described above ). | |
+ | |
+=end | |
+ | |
+ def initialize(parameters) | |
+ | |
+ # The anonymous hash passed in | |
+ @definition = parameters | |
+ @boundaries = definition[:boundaries].split(/\s+by\s+/) | |
+ | |
+ @default_action = lambda do |firstElement,secondElement| | |
+ return "#{firstElement.downcase}_" + | |
+ "#{boundaries[0][0..boundaries[0].length-2]}_" + | |
+ "#{secondElement.downcase}_" + | |
+ "#{boundaries[1][0..boundaries[1].length-2]}" | |
+ end | |
+ | |
+ | |
+ @default_action = @definition[:default_p] unless | |
+ @definition[:default_p].nil? | |
+ | |
+ @tense_wrapping_lambda = lambda do | action_produced_item | | |
+ if @definition[:tense].nil? | |
+ return action_produced_item | |
+ else | |
+ return"#{@definition[:tense]}_tense_#{action_produced_item}" | |
+ end | |
+ end | |
+ | |
+ @matrix=create_matrix | |
+ end | |
+ | |
+=begin rdoc | |
+ | |
+This is the critical method of the class. | |
+ | |
+Based on the boundaries described in the initializing key “:boundaries” a horizontal and | |
+vertical aspect is determined. | |
+ | |
+Foreach element in the horizontal aspect, we pair foreach element within the vertical aspect. | |
+ | |
+These pairs are then subjuct to a lambda. The default lambda can be overridden by passing a lambda | |
+during the call to create_matrix. If the method has an ancillary block, the result is yielded, | |
+if we are not in block-context, the value is stored in a local array and is returned at the | |
+conclusion of the method. | |
+ | |
+Barring a call-specific lambda, the default lambda is called. This can be overridden in the | |
+initialization. Again, if called in block context the value is yielded up, if not, it is added | |
+into the array returned at the end of the method call. | |
+ | |
+TenseBlock.initialize makes a call to create matrix so it is most wise to define the default lambda | |
+at initialization. | |
+ | |
+=end | |
+ | |
+ def create_matrix(alternate_lambda=nil) | |
+ horizontal_aspect = @definition[@boundaries[0].to_sym] | |
+ vertical_aspect = @definition[@boundaries[1].to_sym] | |
+ fabrication = [] | |
+ | |
+ raise "Aspect was nil, did you define hash collections for each boundary?" if horizontal_aspect.nil? or vertical_aspect.nil? | |
+ | |
+ horizontal_aspect.each do |h| | |
+ vertical_aspect.each do|v| | |
+ | |
+ # If an alternate_lambda was provided... | |
+ if not alternate_lambda.nil? | |
+ fabrication.unshift(alternate_lambda.call(h,v)) | |
+ yield fabrication.first if block_given? | |
+ # Otherwise, do the default action and wrap it in the tense-wrapping feature | |
+ elsif not @default_action.nil? | |
+ fabrication.unshift(@tense_wrapping_lambda.call(@default_action.call(h,v))) | |
+ yield fabrication.first if block_given? | |
+ end | |
+ | |
+ end | |
+ end | |
+ | |
+ return fabrication.reverse unless block_given? | |
+ end | |
+ | |
+ # The matrix of nodes, represented as a string. | |
+ | |
+ def to_s | |
+ @matrix.to_s | |
+ end | |
+ | |
+ # The number of elements created in the the matrix. For a 2x2 | |
+ # matrix, this value would be 4. | |
+ | |
+ def length | |
+ return create_matrix.length | |
+ end | |
+ | |
+end | |
\ No newline at end of file | |
diff --git a/lib/linguistics/unicode/SGHUnicode.rb b/lib/linguistics/unicode/SGHUnicode.rb | |
new file mode 100644 | |
index 0000000..b4c7277 | |
--- /dev/null | |
+++ b/lib/linguistics/unicode/SGHUnicode.rb | |
@@ -0,0 +1,247 @@ | |
+# == Synopsis | |
+# | |
+# SGHUnicode : A module for dealing with Unicode headaches, as noted by [S]teven [G] [H]arms | |
+# | |
+# == Usage | |
+# | |
+# load 'language/SGHUnicode.rb' | |
+# | |
+# == Description | |
+# | |
+# The class provides the class UnicodeSafeString. | |
+# | |
+# == Example Code | |
+# | |
+# load 'language/MacronConversions.rb' | |
+# | |
+# | |
+# == Dependencies | |
+# | |
+# None | |
+# | |
+# == Author | |
+# | |
+# Steven G. Harms, http://www.stevengharms.com | |
+# | |
+ | |
+module SGHUnicode | |
+ class UnicodeSafeString < Object | |
+ attr_accessor :USS | |
+ attr_reader :multibyte, :length, :sanitized_array, :original_string | |
+ | |
+ # Initialize takes in a string that may or may not have 16 bit characters in it. | |
+ # It then scans the string to see if any of the characters have an ASCII value greater than 256. | |
+ # | |
+ # If the string is, in fact, multibyte, then the instance methods 'first' and 'rest' can be used to | |
+ # get a LISP-like cons and cdr of the string. In the event that the 'first' is multibyte, USS recognizes | |
+ # this and returns a string of the next _two_ bytes as a string ( i.e. you get the multibyte 'character' ). | |
+ # | |
+ # Also provided is an 'each' function which operates as an iterator through the 'characters' | |
+ # | |
+ # Example: SGHUnicode::UnicodeSafeString.new(content) # generic | |
+ # | |
+ # Example: SGHUnicode::UnicodeSafeString.new(laudāre) #=> multibyte? is true | |
+ # | |
+ # Example: SGHUnicode::UnicodeSafeString.new(fizzlewump) #=> multibyte? is false | |
+ | |
+ def initialize(*given) | |
+ # Null constructor | |
+ if given[0].nil? | |
+ @USS = @original_string = "" | |
+ @uncertain_string_as_array=@detect_multibyte_array=nil | |
+ @length=0 | |
+ @multibyte=false | |
+ return | |
+ end | |
+ | |
+ evaluate_string(given[0]) | |
+ end | |
+ | |
+ def evaluate_string(aString) | |
+ | |
+ if @original_string.nil? | |
+ | |
+ @USS = @original_string = aString | |
+ | |
+ # unpack the string into its constituent characters. If the element is | |
+ # non-ascii, there will be a 0 enry, if not, it will all be 1's. | |
+ @uncertain_string_as_array = @original_string.unpack('U*') | |
+ | |
+ # 1 if it's multibyte, 0 else. | |
+ @detect_multibyte_array=@uncertain_string_as_array.collect{ |char_value| char_value > 256 ? 1 : 0 } | |
+ | |
+ # A safe length to assume for the string based on the unpacked string | |
+ @length = @detect_multibyte_array.length | |
+ | |
+ # Build a string-containing array | |
+ | |
+ @sanitized_array=[] | |
+ each do|sanitized_char| | |
+ @sanitized_array.push(sanitized_char) | |
+ end | |
+ | |
+ # If we find a 0, then we have a multibyte character in here | |
+ if (@detect_multibyte_array.include? 1) | |
+ @multibyte=true | |
+ else | |
+ @USS=@original_string.chomp | |
+ end | |
+ | |
+ else | |
+ @USS = aString | |
+ | |
+ # unpack the string into its constituent characters. If the element is | |
+ # non-ascii, there will be a 0 enry, if not, it will all be 1's. | |
+ @uncertain_string_as_array = aString.unpack('U*') | |
+ | |
+ # 1 if it's multibyte, 0 else. | |
+ @detect_multibyte_array=@uncertain_string_as_array.collect{ |char_value| char_value > 256 ? 1 : 0 } | |
+ | |
+ # A safe length to assume for the string based on the unpacked string | |
+ @length = @detect_multibyte_array.length | |
+ | |
+ # Build a string-containing array | |
+ | |
+ @sanitized_array=[] | |
+ each do|sanitized_char| | |
+ @sanitized_array.push(sanitized_char) | |
+ end | |
+ | |
+ # If we find a 0, then we have a multibyte character in here | |
+ if (@detect_multibyte_array.include? 1) | |
+ @multibyte=true | |
+ else | |
+ @multibyte=false | |
+ end | |
+ | |
+ @USS=aString.chomp | |
+ | |
+ end | |
+ | |
+ end | |
+ | |
+ # Assignment operator | |
+ def self=() | |
+ puts "here" | |
+ end | |
+ | |
+ def [](x) | |
+ # We accommodate Fixnum's and Range's | |
+ unless ( x.class.to_s =~ /(Fixnum|Range)/) | |
+ return nil | |
+ end | |
+ | |
+ | |
+ # Return an item | |
+ if x.class.to_s == "Fixnum" | |
+ # Out of range check | |
+ if x > @length | |
+ raise "Index out of bounds." | |
+ else | |
+ counter = 0 | |
+ sought_value = "" | |
+ each do | |
+ |aChar| | |
+ sought_value=aChar if x.to_i == counter | |
+ counter=counter+1 | |
+ end | |
+ return sought_value | |
+ end | |
+ elsif x.class.to_s == "Range" | |
+ # Fail if you put something out of range! | |
+ if @detect_multibyte_array[x.begin].nil? or @detect_multibyte_array[x.end].nil? | |
+ raise "Subsection request failed for Range" | |
+ end | |
+ # In case they're using the standard range notation | |
+ if x.begin >= 0 and x.end <=@length | |
+ counter = 0 | |
+ sought_values = Array.new | |
+ each do | |
+ |aChar| | |
+ if counter >= x.begin.to_i and counter <= (x.end.to_i < 0 ? x.end.to_i + @length : x.end.to_i) | |
+ sought_values.unshift(aChar) | |
+ end | |
+ counter += 1 | |
+ end | |
+ return sought_values.reverse.to_s | |
+ # In case they're using the negative range notation | |
+ elsif x.begin < 0 and x.end < 0 | |
+ return self[Range.new(@length+x.begin, @length+x.end)] | |
+ end | |
+ else | |
+ puts "bad end" | |
+ raise("Subsection request failed.") | |
+ end | |
+ end | |
+ | |
+ # Provides an 'each character' functionality for a string that may or may not contain | |
+ # multibyte characters. Should be used with a block, much like the traditional | |
+ # Array.each{|x| blah x} invocation | |
+ | |
+ def each | |
+ destructive_copy_content = @uncertain_string_as_array.clone | |
+ destructive_copy_detect = @detect_multibyte_array.clone | |
+ | |
+ index = -1 | |
+ destructive_copy_detect.length.times do |safe_char| | |
+ index +=1 | |
+ if destructive_copy_detect.shift == 0 | |
+ yield destructive_copy_content.shift.chr | |
+ elsif | |
+ yield [destructive_copy_content.shift].pack('U').to_s | |
+ end | |
+ end | |
+ end | |
+ | |
+ # Provides the cons of the first character of the string. | |
+ # I think Python uses the same semantics. I don't know though, I chose Ruby instead. | |
+ | |
+ def first | |
+ return if @detect_multibyte_array[0].nil? | |
+ if @detect_multibyte_array[0] == 0 | |
+ return @original_string[0].chr | |
+ else | |
+ return @original_string[0,2] | |
+ end | |
+ end | |
+ | |
+ # Provides the cons of the first character of the string | |
+ | |
+ def rest | |
+ if @detect_multibyte_array[0] == 0 | |
+ return SGHUnicode::UnicodeSafeString.new(@original_string[1,@original_string.length]) | |
+ else | |
+ return SGHUnicode::UnicodeSafeString.new(@original_string[2,@original_string.length]) | |
+ end | |
+ end | |
+ | |
+ # Accessor for testing presence of multibyte characters | |
+ | |
+ def multibyte? | |
+ return @multibyte | |
+ end | |
+ | |
+ # Returns an array which has 1 in the character positions where a multibyte character was found | |
+ def multibyte_locations | |
+ return @detect_multibyte_array | |
+ end | |
+ | |
+ # Reverse as inherited from string is dangerous! | |
+ def reverse | |
+ good_array=Array.new | |
+ each{|letter| good_array.unshift(letter)} | |
+ return good_array.to_s | |
+ end | |
+ | |
+ # To retrieve the array into which the characters were initially unpacked | |
+ def to_a | |
+ return @sanitized_array | |
+ end | |
+ | |
+ # So that this can be printed easily | |
+ | |
+ def to_s | |
+ return @original_string | |
+ end | |
+ end | |
+end | |
\ No newline at end of file | |
diff --git a/tests/la/first_conjugation.tests.rb b/tests/la/first_conjugation.tests.rb | |
index bd03295..fae622b 100755 | |
--- a/tests/la/first_conjugation.tests.rb | |
+++ b/tests/la/first_conjugation.tests.rb | |
@@ -26,6 +26,186 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
assert_respond_to Linguistics::LA, :razzle | |
end | |
+ def setup | |
+ @aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
+ end | |
+ | |
+ def teardown | |
+ aFirst=0 | |
+ end | |
+ | |
+ def test_display_call | |
+ assert_nothing_raised(RuntimeError) { | |
+ @aFirst.full_conjugation | |
+ @aFirst.display_full_listing | |
+ } | |
+ end | |
+ | |
+ def test_nodes_exhaustively | |
+ assert_equal("amō", @aFirst.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amās", @aFirst.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amat", @aFirst.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāmus", @aFirst.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amātis", @aFirst.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("amant", @aFirst.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābam", @aFirst.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amābās", @aFirst.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābat", @aFirst.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābāmus", @aFirst.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābātis", @aFirst.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābant", @aFirst.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābō", @aFirst.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("amābis", @aFirst.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābit", @aFirst.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābimus", @aFirst.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābitis", @aFirst.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābunt", @aFirst.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāvī", @aFirst.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāvistī", @aFirst.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāvit", @aFirst.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāvimus", @aFirst.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāvistis", @aFirst.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāvērunt", @aFirst.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāveram", @aFirst.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāverās", @aFirst.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāverat", @aFirst.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāverāmus", @aFirst.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāverātis", @aFirst.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāverant", @aFirst.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāverō", @aFirst.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāveris", @aFirst.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāverit", @aFirst.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāverimus", @aFirst.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāveritis", @aFirst.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāverint", @aFirst.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive Present | |
+ | |
+ assert_equal("amor", @aFirst.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāris", @aFirst.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amātur", @aFirst.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāmur", @aFirst.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāminī", @aFirst.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("amantur", @aFirst.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābar", @aFirst.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amābāris", @aFirst.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābātur", @aFirst.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābāmur", @aFirst.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābāminī", @aFirst.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābantur", @aFirst.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābor", @aFirst.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāberis", @aFirst.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābitur", @aFirst.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābimur", @aFirst.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābiminī", @aFirst.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābuntur", @aFirst.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive perfect | |
+ assert_equal("amatum sum", @aFirst.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amatum es", @aFirst.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amatum est", @aFirst.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amatum sumus", @aFirst.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amatum estis", @aFirst.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amatum sunt", @aFirst.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amatum eram", @aFirst.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amatum erās", @aFirst.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amatum erat", @aFirst.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amatum erāmus", @aFirst.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amatum erātis", @aFirst.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amatum erant", @aFirst.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amatum erō", @aFirst.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amatum eris", @aFirst.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amatum erit", @aFirst.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amatum erimus", @aFirst.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amatum eritis", @aFirst.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amatum erint", @aFirst.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ ### Subjunctives | |
+ # Active | |
+ assert_equal("amem", @aFirst.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amēs", @aFirst.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amet", @aFirst.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amēmus", @aFirst.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amētis", @aFirst.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("ament", @aFirst.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amārem", @aFirst.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāres", @aFirst.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāret", @aFirst.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāremus", @aFirst.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāretis", @aFirst.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amārent", @aFirst.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāverim", @aFirst.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāverīs", @aFirst.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāverit", @aFirst.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāverīmus", @aFirst.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāverītis", @aFirst.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāverint", @aFirst.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāvissem", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāvissēs", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāvisset", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāvissēmus", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāvissētis", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāvissent", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ #passive | |
+ assert_equal("amer", @aFirst.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amēris", @aFirst.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amētur", @aFirst.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amēmur", @aFirst.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amēminī", @aFirst.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("amentur", @aFirst.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amārer", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amārēris", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amārētur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amārēmur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amārēminī", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amārentur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ amatus, amata, amatum ] sim", @aFirst.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] sis", @aFirst.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] sit", @aFirst.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] simus", @aFirst.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] sitis", @aFirst.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] sint", @aFirst.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ amatus, amata, amatum ] essem", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] essēs", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] esset", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] essēmus", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] essētis", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] essent", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Imperatives | |
+ puts "NARFT: #{@aFirst.imperatives[0].to_s}" | |
+ assert_equal("amā", @aFirst.imperatives[0].to_s) | |
+ assert_equal("amāte", @aFirst.imperatives[1].to_s) | |
+ | |
+ # Participles | |
+ assert_equal("amāns, amantis", @aFirst.present_active_participle ) | |
+ assert_equal("amatūrus, amatūra, amatūrum", @aFirst.future_active_participle) | |
+ assert_equal("amatus, amata, amatum", @aFirst.perfect_passive_participle) | |
+ assert_equal("amandus, amanda, amandum", @aFirst.future_passive_participle) | |
+ | |
+ # Infinitves | |
+ assert_equal("amāre", @aFirst.present_active_infinitive.to_s) | |
+ assert_equal("amāvīsse", @aFirst.perfect_active_infinitive) | |
+ assert_equal("amatūrus esse", @aFirst.future_active_infinitive) | |
+ assert_equal("amārī", @aFirst.present_passive_infinitive) | |
+ assert_equal("amatus, amata, amatum esse", @aFirst.perfect_passive_infinitive) | |
+ end | |
end | |
diff --git a/tests/la/fourth_conjugation.tests.rb b/tests/la/fourth_conjugation.tests.rb | |
new file mode 100755 | |
index 0000000..8a1a746 | |
--- /dev/null | |
+++ b/tests/la/fourth_conjugation.tests.rb | |
@@ -0,0 +1,32 @@ | |
+#!/usr/bin/ruby -w | |
+# | |
+# Unit test for (Latin Verb Conjugation: First conjugation: /.*āre/. | |
+# Canonical example: laudāre: to praise) | |
+# | |
+# Copyright (c) (2008-9) Steven G. Harms | |
+# | |
+ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+### This test case tests ... | |
+class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+ | |
+ def initialize( *args ) | |
+ super | |
+ Linguistics::use( :la ) | |
+ end | |
+ | |
+ def test_0000_loaded | |
+ assert_respond_to Linguistics::LA, :razzle | |
+ end | |
+ | |
+ def test_first_conjugation | |
+end | |
+ | |
+ | |
diff --git a/tests/la/second_conjugation.tests.rb b/tests/la/second_conjugation.tests.rb | |
new file mode 100755 | |
index 0000000..8a1a746 | |
--- /dev/null | |
+++ b/tests/la/second_conjugation.tests.rb | |
@@ -0,0 +1,32 @@ | |
+#!/usr/bin/ruby -w | |
+# | |
+# Unit test for (Latin Verb Conjugation: First conjugation: /.*āre/. | |
+# Canonical example: laudāre: to praise) | |
+# | |
+# Copyright (c) (2008-9) Steven G. Harms | |
+# | |
+ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+### This test case tests ... | |
+class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+ | |
+ def initialize( *args ) | |
+ super | |
+ Linguistics::use( :la ) | |
+ end | |
+ | |
+ def test_0000_loaded | |
+ assert_respond_to Linguistics::LA, :razzle | |
+ end | |
+ | |
+ def test_first_conjugation | |
+end | |
+ | |
+ | |
diff --git a/tests/la/third-io_conjugation.tests.rb b/tests/la/third-io_conjugation.tests.rb | |
new file mode 100755 | |
index 0000000..8a1a746 | |
--- /dev/null | |
+++ b/tests/la/third-io_conjugation.tests.rb | |
@@ -0,0 +1,32 @@ | |
+#!/usr/bin/ruby -w | |
+# | |
+# Unit test for (Latin Verb Conjugation: First conjugation: /.*āre/. | |
+# Canonical example: laudāre: to praise) | |
+# | |
+# Copyright (c) (2008-9) Steven G. Harms | |
+# | |
+ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+### This test case tests ... | |
+class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+ | |
+ def initialize( *args ) | |
+ super | |
+ Linguistics::use( :la ) | |
+ end | |
+ | |
+ def test_0000_loaded | |
+ assert_respond_to Linguistics::LA, :razzle | |
+ end | |
+ | |
+ def test_first_conjugation | |
+end | |
+ | |
+ | |
diff --git a/tests/la/third_conjugation.tests.rb b/tests/la/third_conjugation.tests.rb | |
new file mode 100755 | |
index 0000000..8a1a746 | |
--- /dev/null | |
+++ b/tests/la/third_conjugation.tests.rb | |
@@ -0,0 +1,32 @@ | |
+#!/usr/bin/ruby -w | |
+# | |
+# Unit test for (Latin Verb Conjugation: First conjugation: /.*āre/. | |
+# Canonical example: laudāre: to praise) | |
+# | |
+# Copyright (c) (2008-9) Steven G. Harms | |
+# | |
+ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+### This test case tests ... | |
+class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+ | |
+ def initialize( *args ) | |
+ super | |
+ Linguistics::use( :la ) | |
+ end | |
+ | |
+ def test_0000_loaded | |
+ assert_respond_to Linguistics::LA, :razzle | |
+ end | |
+ | |
+ def test_first_conjugation | |
+end | |
+ | |
+ | |
-- | |
1.6.3.1 | |
From 60c9827551050ec24e0bc6020e981c72306f643c Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 11:10:33 -0500 | |
Subject: [PATCH 05/11] Got rid of LatinIRB. Fixed internal library pathing. | |
First conjugation test almost works! | |
--- | |
lib/linguistics.rb | 4 +- | |
lib/linguistics/la.rb | 14 +- | |
lib/linguistics/la/LatinIRB.rb | 279 ------------------------- | |
lib/linguistics/la/LatinVerb.rb | 14 +- | |
lib/linguistics/la/LatinWord.rb | 2 +- | |
lib/linguistics/language/MacronConversions.rb | 2 +- | |
tests/en/infinitive.tests.rb | 2 +- | |
tests/la/first_conjugation.tests.rb | 1 + | |
8 files changed, 25 insertions(+), 293 deletions(-) | |
delete mode 100644 lib/linguistics/la/LatinIRB.rb | |
diff --git a/lib/linguistics.rb b/lib/linguistics.rb | |
index c25ea1e..7ac6551 100644 | |
--- a/lib/linguistics.rb | |
+++ b/lib/linguistics.rb | |
@@ -156,8 +156,8 @@ module Linguistics | |
# Create an languageProxy class for each language specified | |
languages.each do |lang| | |
- # $stderr.puts "Extending the %p class with %p" % | |
- # [ klass, lang ] if $DEBUG | |
+ #$stderr.puts "Extending the %p class with %p" % | |
+ # [ klass, lang ] if $DEBUG | |
# Load the language module (skipping to the next if it's already | |
# loaded), make a languageProxy class that delegates to it, and | |
diff --git a/lib/linguistics/la.rb b/lib/linguistics/la.rb | |
index 65e4025..94ba637 100644 | |
--- a/lib/linguistics/la.rb | |
+++ b/lib/linguistics/la.rb | |
@@ -14,8 +14,18 @@ module Linguistics::LA | |
Linguistics::DefaultLanguages << :la | |
# Load in the secondary modules and add them to Linguistics::EN. | |
- require 'linguistics/la/' | |
- | |
+ require 'linguistics/la/LatinConjugation.rb' | |
+ require 'linguistics/la/LatinDisplay.rb' | |
+ require 'linguistics/la/LatinNode.rb' | |
+ require 'linguistics/la/LatinTense.rb' | |
+ require 'linguistics/la/LatinVerb.rb' | |
+ require 'linguistics/la/LatinWord.rb' | |
+ | |
+ require 'linguistics/language/MacronConversions.rb' | |
+ require 'linguistics/language/TenseBlock.rb' | |
+ | |
+ require 'linguistics/unicode/SGHUnicode.rb' | |
+ | |
############### | |
module_function | |
############### | |
diff --git a/lib/linguistics/la/LatinIRB.rb b/lib/linguistics/la/LatinIRB.rb | |
deleted file mode 100644 | |
index 2ca71ba..0000000 | |
--- a/lib/linguistics/la/LatinIRB.rb | |
+++ /dev/null | |
@@ -1,279 +0,0 @@ | |
-#!/usr/bin/env ruby | |
- | |
-=begin rdoc | |
- | |
-== Synopsis | |
- | |
-LatinIRB: An IRB-based environment for working with Latin::LatinVerbs items. LatinIRB | |
-provides a space for command-line based exploration of Latin Verbs following into the | |
-find standard paradigms described by Wheelock as: 1st, 2nd, 3rd, 3rd-"IO", and 4th conjugations. | |
- | |
-Upon opening the script, the student may play with verbs offered for exploration. These are the standard: | |
- | |
- Varible : Parts : meaning | |
- * LatinVerb. : amō amāre amāvī amatum : to love / like | |
- * @aSecond : moneō monēre monvī monitum : to warn / advise | |
- * @aThird : agō agere ēgī actum : to do / lead / undertake | |
- * @aThirdIO : capiō capere cēpī captum : to grab / seize | |
- * @aFourth : audiō audīre audīvī auditum : to hear | |
- | |
-== Usage | |
- | |
-./LatinIRB | |
- | |
-== Viewing | |
- | |
-The environment takes advantage of Ruby's UTF-8 support to display the verbs with macrons ( notation representing | |
-tho quantity of the vowels ). I recommend that you use urxvt ( what I use ) or Apple's Terminal.app for | |
-viewing these entries. | |
- | |
-== Macrons | |
- | |
-As mentioned above, to help in pronunciation, the LatinIRB, and the Latin:: module that provides its functions, | |
-is macron aware. Provided it is given macrons in the initialization ( see below ) it knows when to shorten | |
-the macron and when to preserve it. Character palette access for these glyphs is annoying. Looking to | |
-LaTeX I found an ASCII-based standard for macron entry and provide it here for use in entry. | |
- | |
-The array of four principle parts can be gained by issuing the following: | |
- | |
- MacronConverter.new('\={e}duc\={o} \={e}duc\={a}re \={e}duc\={a}v\={\i} \={e}ducatus') | |
- | |
-This can be passed to the LatinVerb constructor ( see below ) | |
- | |
-== Generating Verbs | |
- | |
-Typically, in the code I have used the macron-ized character because Textmate and my Terminal of choice | |
-both understand it. | |
- | |
- LatinVerb.new %w(amō amāre amāvī amatum) | |
- | |
-another way is: | |
- | |
- converted_metachar=MacronConverter.new('\={e}duc\={o} \={e}duc\={a}re \={e}duc\={a}v\={\i} \={e}ducatus') | |
- anLV=LatinVerb.new(converted_metachar.to_a) | |
- | |
-Thereafter you can execute : | |
- anLV.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number #=> [ ēducatī, ēducatae, ēducata ] essēmus | |
- | |
-== Executing Methods | |
- | |
-Every verb in latin is a "vector" comprised of the voice / mood / tense / number / and person | |
- | |
-=== Chart View | |
- | |
-To view the chart of a verb, use LatinVerb.chart_display. This is a basic chart that will | |
-look familiar to students. | |
- | |
-=== Singular Vector | |
- | |
-As such methods are of the form | |
- | |
- (active|passive)_voice_(indicative|subjunctive)_mood_(present|imperfect|perfect|pastperfect|futureperfect|etc.)tense_first_person_singular_number | |
- | |
-This will return a single value. Where the result is ambiguous ( e.g. 'number' is not provided ) multiple values are returned. | |
-an exhaustive list of options follows below. | |
- | |
-=== Multiplex Vectors | |
- | |
-Several convenience methods exist which load multiple tenses at the same time such as "present system" or "perfect system". These | |
-methods load the tenses into the @collections iVar associated with the LatinVerb. This value can be accessed as @collections | |
-is shared per attr_reader | |
- | |
-=== Chart View | |
- | |
-By using the LatinDisplay.chart_view, a chart, much like what is found in verb references can be had for the verb. This is a | |
-_very_ handy method. | |
- | |
-=== Comprehensive List of Singular Vectors | |
- | |
- * LatinVerb.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
- | |
- | |
- * LatinVerb.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
- * | |
- * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- * LatinVerb.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- | |
- * LatinVerb.imperatives[0].to_s) | |
- * LatinVerb.imperatives[1].to_s) | |
- | |
- * LatinVerb.present_active_participle ) | |
- * LatinVerb.future_active_participle) | |
- * LatinVerb.perfect_passive_participle) | |
- * LatinVerb.future_passive_participle) | |
- | |
- * LatinVerb.present_active_infinitive.to_s) | |
- * LatinVerb.perfect_active_infinitive) | |
- * LatinVerb.future_active_infinitive) | |
- * LatinVerb.present_passive_infinitive) | |
- * LatinVerb.perfect_passive_infinitive) | |
-=end | |
- | |
-require 'latin/LatinVerb' | |
-require 'language/MacronConversions' | |
-require 'irb' | |
-require 'irb/completion' | |
- | |
-include MacronConversions | |
-include Latin | |
- | |
-@aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
-@aSecond = Latin::LatinVerb.new %w(moneō monēre monvī monitum) | |
-@aThird = Latin::LatinVerb.new %w(agō agere ēgī actum) | |
-@aThirdIO = Latin::LatinVerb.new %w(capiō capere cēpī captum) | |
-@aFourth = Latin::LatinVerb.new %w(audiō audīre audīvī auditum) | |
- | |
-IRB.start | |
- | |
-=begin rdoc | |
- | |
-== Conclusion | |
- | |
-Enjoy and explore mundus latinae | |
- | |
-== Author | |
- | |
-Steven G. Harms ( [email protected] ) | |
- | |
-== Thanks | |
- | |
-Thanks to the Austin Ruby coders group who answered questions that helped me put this all together. Thanks also | |
-to the Reject^{2} conference at the Lone Star Ruby Conference 2008 who helped me think through some of the | |
-metaprogrammatic approaches. Thanks to Professor James Burleson of Austin Community College who insisted, | |
-old-style, of a mastery of the rote basics of Latin. Thanks also to Lauren Roth ( http://www.laurennroth.com) | |
-for her support and encouragement and understanding of my pre-dawn hack sessions. | |
- | |
-=end | |
diff --git a/lib/linguistics/la/LatinVerb.rb b/lib/linguistics/la/LatinVerb.rb | |
index bf65cce..887ffac 100644 | |
--- a/lib/linguistics/la/LatinVerb.rb | |
+++ b/lib/linguistics/la/LatinVerb.rb | |
@@ -1,10 +1,10 @@ | |
-require 'unicode/SGHUnicode' | |
-require 'language/TenseBlock' | |
-require 'latin/LatinWord' | |
-require 'latin/LatinNode' | |
-require 'latin/LatinConjugation' | |
-require 'latin/LatinDisplay' | |
-require 'latin/LatinTense' | |
+require 'linguistics/unicode/SGHUnicode' | |
+require 'linguistics/language/TenseBlock' | |
+require 'linguistics/la/LatinWord' | |
+require 'linguistics/la/LatinNode' | |
+require 'linguistics/la/LatinConjugation' | |
+require 'linguistics/la/LatinDisplay' | |
+require 'linguistics/la/LatinTense' | |
module Latin | |
diff --git a/lib/linguistics/la/LatinWord.rb b/lib/linguistics/la/LatinWord.rb | |
index 5b19089..a409b37 100644 | |
--- a/lib/linguistics/la/LatinWord.rb | |
+++ b/lib/linguistics/la/LatinWord.rb | |
@@ -27,7 +27,7 @@ | |
# Steven G. Harms, http://www.stevengharms.com | |
# | |
-require 'unicode/SGHUnicode' | |
+require 'linguistics/unicode/SGHUnicode' | |
module Latin | |
class LatinWord < SGHUnicode::UnicodeSafeString | |
diff --git a/lib/linguistics/language/MacronConversions.rb b/lib/linguistics/language/MacronConversions.rb | |
index 74ceb66..9b991ef 100644 | |
--- a/lib/linguistics/language/MacronConversions.rb | |
+++ b/lib/linguistics/language/MacronConversions.rb | |
@@ -39,7 +39,7 @@ | |
# Steven G. Harms, http://www.stevengharms.com | |
module MacronConversions | |
- require 'unicode/SGHUnicode' | |
+ require 'linguistics/unicode/SGHUnicode' | |
LATEX_TO_MACRONS_CHARACTERS = { | |
"\\={a}" => "ā", | |
diff --git a/tests/en/infinitive.tests.rb b/tests/en/infinitive.tests.rb | |
index 3112d09..0b141f2 100644 | |
--- a/tests/en/infinitive.tests.rb | |
+++ b/tests/en/infinitive.tests.rb | |
@@ -9,7 +9,7 @@ | |
unless defined? Linguistics::TestCase | |
testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
$LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
- | |
+ | |
require 'lingtestcase' | |
end | |
diff --git a/tests/la/first_conjugation.tests.rb b/tests/la/first_conjugation.tests.rb | |
index fae622b..4e3b622 100755 | |
--- a/tests/la/first_conjugation.tests.rb | |
+++ b/tests/la/first_conjugation.tests.rb | |
@@ -28,6 +28,7 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
def setup | |
@aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
+ raise RuntimeException unless @aFirst | |
end | |
def teardown | |
-- | |
1.6.3.1 | |
From bc70bbda7572ad9fc89c776fec0bcc4db770367c Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 11:31:25 -0500 | |
Subject: [PATCH 06/11] Got rid of warnings | |
--- | |
lib/linguistics/la/LatinTense.rb | 7 ++++++- | |
lib/linguistics/unicode/SGHUnicode.rb | 5 ++++- | |
2 files changed, 10 insertions(+), 2 deletions(-) | |
diff --git a/lib/linguistics/la/LatinTense.rb b/lib/linguistics/la/LatinTense.rb | |
index da93606..fa534b4 100644 | |
--- a/lib/linguistics/la/LatinTense.rb | |
+++ b/lib/linguistics/la/LatinTense.rb | |
@@ -48,7 +48,12 @@ Latin::LatinTense object is constructed. | |
verb_methods << method_name | |
# Actually create the methods for accessing the values | |
- self.class.send(:define_method, method_name) { @collections.pop unless @collections.nil?; return node.value } | |
+ self.class.send(:define_method, method_name) { | |
+ @collections.pop unless ( | |
+ (not defined? @collections) || | |
+ @collections.nil? ) | |
+ return node.value | |
+ } | |
# Push the node values into an array, it should wind up like: | |
# [node1, node2, node3]. It's just for convenience, really. | |
diff --git a/lib/linguistics/unicode/SGHUnicode.rb b/lib/linguistics/unicode/SGHUnicode.rb | |
index b4c7277..d74ce39 100644 | |
--- a/lib/linguistics/unicode/SGHUnicode.rb | |
+++ b/lib/linguistics/unicode/SGHUnicode.rb | |
@@ -59,7 +59,10 @@ module SGHUnicode | |
def evaluate_string(aString) | |
- if @original_string.nil? | |
+ if ( | |
+ (not defined? @original ) || | |
+ @original_string.nil? | |
+ ) | |
@USS = @original_string = aString | |
-- | |
1.6.3.1 | |
From 9fb730cb6fe2c7eef3ed86127d67ac96af6802e6 Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 14:13:21 -0500 | |
Subject: [PATCH 07/11] Imported full Test suite from LatinVerb library | |
--- | |
tests/la/first_conjugation.tests.rb | 359 ++++++++++++++++---------------- | |
tests/la/fourth_conjugation.tests.rb | 179 ++++++++++++++++- | |
tests/la/second_conjugation.tests.rb | 180 ++++++++++++++++- | |
tests/la/testLatinVerb.rb | 71 +++++++ | |
tests/la/testLatinWord.rb | 32 +++ | |
tests/la/testSuite.rb | 45 ++++ | |
tests/la/testTenseBlock.rb | 33 +++ | |
tests/la/testUnicodeSafeString.rb | 52 +++++ | |
tests/la/third-io_conjugation.tests.rb | 180 ++++++++++++++++- | |
tests/la/third_conjugation.tests.rb | 179 ++++++++++++++++- | |
10 files changed, 1122 insertions(+), 188 deletions(-) | |
create mode 100755 tests/la/testLatinVerb.rb | |
create mode 100755 tests/la/testLatinWord.rb | |
create mode 100755 tests/la/testSuite.rb | |
create mode 100755 tests/la/testTenseBlock.rb | |
create mode 100755 tests/la/testUnicodeSafeString.rb | |
diff --git a/tests/la/first_conjugation.tests.rb b/tests/la/first_conjugation.tests.rb | |
index 4e3b622..aaa4bd1 100755 | |
--- a/tests/la/first_conjugation.tests.rb | |
+++ b/tests/la/first_conjugation.tests.rb | |
@@ -26,186 +26,185 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
assert_respond_to Linguistics::LA, :razzle | |
end | |
- def setup | |
- @aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
- raise RuntimeException unless @aFirst | |
- end | |
- | |
- def teardown | |
- aFirst=0 | |
- end | |
- | |
- def test_display_call | |
- assert_nothing_raised(RuntimeError) { | |
- @aFirst.full_conjugation | |
- @aFirst.display_full_listing | |
- } | |
- end | |
- | |
- def test_nodes_exhaustively | |
- assert_equal("amō", @aFirst.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
- assert_equal("amās", @aFirst.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
- assert_equal("amat", @aFirst.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
- assert_equal("amāmus", @aFirst.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
- assert_equal("amātis", @aFirst.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
- assert_equal("amant", @aFirst.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amābam", @aFirst.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amābās", @aFirst.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amābat", @aFirst.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amābāmus", @aFirst.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amābātis", @aFirst.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amābant", @aFirst.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amābō", @aFirst.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
- assert_equal("amābis", @aFirst.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
- assert_equal("amābit", @aFirst.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
- assert_equal("amābimus", @aFirst.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
- assert_equal("amābitis", @aFirst.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
- assert_equal("amābunt", @aFirst.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amāvī", @aFirst.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amāvistī", @aFirst.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amāvit", @aFirst.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amāvimus", @aFirst.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amāvistis", @aFirst.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amāvērunt", @aFirst.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amāveram", @aFirst.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amāverās", @aFirst.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amāverat", @aFirst.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amāverāmus", @aFirst.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amāverātis", @aFirst.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amāverant", @aFirst.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amāverō", @aFirst.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amāveris", @aFirst.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amāverit", @aFirst.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amāverimus", @aFirst.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amāveritis", @aFirst.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amāverint", @aFirst.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
- | |
- # Passive Present | |
- | |
- assert_equal("amor", @aFirst.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
- assert_equal("amāris", @aFirst.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
- assert_equal("amātur", @aFirst.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
- assert_equal("amāmur", @aFirst.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
- assert_equal("amāminī", @aFirst.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
- assert_equal("amantur", @aFirst.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amābar", @aFirst.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amābāris", @aFirst.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amābātur", @aFirst.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amābāmur", @aFirst.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amābāminī", @aFirst.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amābantur", @aFirst.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amābor", @aFirst.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
- assert_equal("amāberis", @aFirst.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
- assert_equal("amābitur", @aFirst.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
- assert_equal("amābimur", @aFirst.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
- assert_equal("amābiminī", @aFirst.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
- assert_equal("amābuntur", @aFirst.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
- | |
- # Passive perfect | |
- assert_equal("amatum sum", @aFirst.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amatum es", @aFirst.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amatum est", @aFirst.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amatum sumus", @aFirst.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amatum estis", @aFirst.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amatum sunt", @aFirst.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amatum eram", @aFirst.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amatum erās", @aFirst.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amatum erat", @aFirst.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amatum erāmus", @aFirst.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amatum erātis", @aFirst.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amatum erant", @aFirst.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amatum erō", @aFirst.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amatum eris", @aFirst.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amatum erit", @aFirst.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amatum erimus", @aFirst.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amatum eritis", @aFirst.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amatum erint", @aFirst.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
- | |
- ### Subjunctives | |
- # Active | |
- assert_equal("amem", @aFirst.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
- assert_equal("amēs", @aFirst.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
- assert_equal("amet", @aFirst.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
- assert_equal("amēmus", @aFirst.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
- assert_equal("amētis", @aFirst.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
- assert_equal("ament", @aFirst.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amārem", @aFirst.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amāres", @aFirst.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amāret", @aFirst.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amāremus", @aFirst.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amāretis", @aFirst.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amārent", @aFirst.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amāverim", @aFirst.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amāverīs", @aFirst.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amāverit", @aFirst.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amāverīmus", @aFirst.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amāverītis", @aFirst.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amāverint", @aFirst.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amāvissem", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amāvissēs", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amāvisset", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amāvissēmus", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amāvissētis", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amāvissent", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- | |
- #passive | |
- assert_equal("amer", @aFirst.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
- assert_equal("amēris", @aFirst.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
- assert_equal("amētur", @aFirst.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
- assert_equal("amēmur", @aFirst.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
- assert_equal("amēminī", @aFirst.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
- assert_equal("amentur", @aFirst.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("amārer", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("amārēris", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("amārētur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("amārēmur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("amārēminī", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("amārentur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("[ amatus, amata, amatum ] sim", @aFirst.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
- assert_equal("[ amatus, amata, amatum ] sis", @aFirst.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
- assert_equal("[ amatus, amata, amatum ] sit", @aFirst.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
- assert_equal("[ amatī, amatae, amata ] simus", @aFirst.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
- assert_equal("[ amatī, amatae, amata ] sitis", @aFirst.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
- assert_equal("[ amatī, amatae, amata ] sint", @aFirst.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
- | |
- assert_equal("[ amatus, amata, amatum ] essem", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
- assert_equal("[ amatus, amata, amatum ] essēs", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
- assert_equal("[ amatus, amata, amatum ] esset", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
- assert_equal("[ amatī, amatae, amata ] essēmus", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
- assert_equal("[ amatī, amatae, amata ] essētis", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
- assert_equal("[ amatī, amatae, amata ] essent", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
- | |
- # Imperatives | |
- puts "NARFT: #{@aFirst.imperatives[0].to_s}" | |
- assert_equal("amā", @aFirst.imperatives[0].to_s) | |
- assert_equal("amāte", @aFirst.imperatives[1].to_s) | |
- | |
- # Participles | |
- assert_equal("amāns, amantis", @aFirst.present_active_participle ) | |
- assert_equal("amatūrus, amatūra, amatūrum", @aFirst.future_active_participle) | |
- assert_equal("amatus, amata, amatum", @aFirst.perfect_passive_participle) | |
- assert_equal("amandus, amanda, amandum", @aFirst.future_passive_participle) | |
- | |
- # Infinitves | |
- assert_equal("amāre", @aFirst.present_active_infinitive.to_s) | |
- assert_equal("amāvīsse", @aFirst.perfect_active_infinitive) | |
- assert_equal("amatūrus esse", @aFirst.future_active_infinitive) | |
- assert_equal("amārī", @aFirst.present_passive_infinitive) | |
- assert_equal("amatus, amata, amatum esse", @aFirst.perfect_passive_infinitive) | |
+ def setup | |
+ @aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
+ raise RuntimeException unless @aFirst | |
+ end | |
+ | |
+ def teardown | |
+ aFirst=0 | |
+ end | |
+ | |
+ def test_display_call | |
+ assert_nothing_raised(RuntimeError) { | |
+ @aFirst.full_conjugation | |
+ @aFirst.display_full_listing | |
+ } | |
+ end | |
+ | |
+ def test_nodes_exhaustively | |
+ assert_equal("amō", @aFirst.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amās", @aFirst.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amat", @aFirst.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāmus", @aFirst.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amātis", @aFirst.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("amant", @aFirst.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābam", @aFirst.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amābās", @aFirst.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābat", @aFirst.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābāmus", @aFirst.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābātis", @aFirst.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābant", @aFirst.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābō", @aFirst.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("amābis", @aFirst.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābit", @aFirst.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābimus", @aFirst.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābitis", @aFirst.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābunt", @aFirst.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāvī", @aFirst.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāvistī", @aFirst.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāvit", @aFirst.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāvimus", @aFirst.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāvistis", @aFirst.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāvērunt", @aFirst.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāveram", @aFirst.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāverās", @aFirst.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāverat", @aFirst.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāverāmus", @aFirst.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāverātis", @aFirst.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāverant", @aFirst.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāverō", @aFirst.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāveris", @aFirst.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāverit", @aFirst.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāverimus", @aFirst.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāveritis", @aFirst.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāverint", @aFirst.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+# Passive Present | |
+ | |
+ assert_equal("amor", @aFirst.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāris", @aFirst.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amātur", @aFirst.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāmur", @aFirst.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāminī", @aFirst.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("amantur", @aFirst.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābar", @aFirst.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amābāris", @aFirst.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābātur", @aFirst.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābāmur", @aFirst.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābāminī", @aFirst.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābantur", @aFirst.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amābor", @aFirst.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāberis", @aFirst.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("amābitur", @aFirst.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("amābimur", @aFirst.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("amābiminī", @aFirst.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("amābuntur", @aFirst.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+# Passive perfect | |
+ assert_equal("amatum sum", @aFirst.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amatum es", @aFirst.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amatum est", @aFirst.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amatum sumus", @aFirst.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amatum estis", @aFirst.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amatum sunt", @aFirst.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amatum eram", @aFirst.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amatum erās", @aFirst.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amatum erat", @aFirst.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amatum erāmus", @aFirst.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amatum erātis", @aFirst.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amatum erant", @aFirst.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amatum erō", @aFirst.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amatum eris", @aFirst.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amatum erit", @aFirst.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amatum erimus", @aFirst.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amatum eritis", @aFirst.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amatum erint", @aFirst.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+### Subjunctives | |
+ # Active | |
+ assert_equal("amem", @aFirst.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amēs", @aFirst.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amet", @aFirst.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amēmus", @aFirst.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amētis", @aFirst.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("ament", @aFirst.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amārem", @aFirst.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāres", @aFirst.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāret", @aFirst.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāremus", @aFirst.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāretis", @aFirst.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amārent", @aFirst.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāverim", @aFirst.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāverīs", @aFirst.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāverit", @aFirst.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāverīmus", @aFirst.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāverītis", @aFirst.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāverint", @aFirst.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amāvissem", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amāvissēs", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amāvisset", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amāvissēmus", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amāvissētis", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amāvissent", @aFirst.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ #passive | |
+ assert_equal("amer", @aFirst.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("amēris", @aFirst.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("amētur", @aFirst.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("amēmur", @aFirst.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("amēminī", @aFirst.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("amentur", @aFirst.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("amārer", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("amārēris", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("amārētur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("amārēmur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("amārēminī", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("amārentur", @aFirst.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ amatus, amata, amatum ] sim", @aFirst.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] sis", @aFirst.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] sit", @aFirst.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] simus", @aFirst.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] sitis", @aFirst.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] sint", @aFirst.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ amatus, amata, amatum ] essem", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] essēs", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ amatus, amata, amatum ] esset", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] essēmus", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] essētis", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ amatī, amatae, amata ] essent", @aFirst.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Imperatives | |
+ assert_equal("amā", @aFirst.imperatives[0].to_s) | |
+ assert_equal("amāte", @aFirst.imperatives[1].to_s) | |
+ | |
+ # Participles | |
+ assert_equal("amāns, amantis", @aFirst.present_active_participle ) | |
+ assert_equal("amatūrus, amatūra, amatūrum", @aFirst.future_active_participle) | |
+ assert_equal("amatus, amata, amatum", @aFirst.perfect_passive_participle) | |
+ assert_equal("amandus, amanda, amandum", @aFirst.future_passive_participle) | |
+ | |
+ # Infinitves | |
+ assert_equal("amāre", @aFirst.present_active_infinitive.to_s) | |
+ assert_equal("amāvīsse", @aFirst.perfect_active_infinitive) | |
+ assert_equal("amatūrus esse", @aFirst.future_active_infinitive) | |
+ assert_equal("amārī", @aFirst.present_passive_infinitive) | |
+ assert_equal("amatus, amata, amatum esse", @aFirst.perfect_passive_infinitive) | |
end | |
end | |
diff --git a/tests/la/fourth_conjugation.tests.rb b/tests/la/fourth_conjugation.tests.rb | |
index 8a1a746..544b07d 100755 | |
--- a/tests/la/fourth_conjugation.tests.rb | |
+++ b/tests/la/fourth_conjugation.tests.rb | |
@@ -15,7 +15,7 @@ end | |
require 'linguistics' | |
### This test case tests ... | |
-class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+class LatinVerbFourthConjugationTestCase < Linguistics::TestCase | |
def initialize( *args ) | |
super | |
@@ -26,7 +26,182 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
assert_respond_to Linguistics::LA, :razzle | |
end | |
- def test_first_conjugation | |
+ def setup | |
+ @aFourth = Latin::LatinVerb.new %w(audiō audīre audīvī auditum) | |
+ | |
+ end | |
+ | |
+ def test_display_call | |
+ assert_nothing_raised(RuntimeError) { | |
+ @aFourth.full_conjugation | |
+ @aFourth.display_full_listing | |
+ } | |
+ end | |
+ | |
+ def test_exhaustive | |
+ assert_equal("audiō", @aFourth.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("audis", @aFourth.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("audit", @aFourth.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("audimus", @aFourth.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("auditis", @aFourth.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("audiunt", @aFourth.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audiēbam", @aFourth.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audiēbās", @aFourth.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audiēbat", @aFourth.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audiēbāmus", @aFourth.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audiēbātis", @aFourth.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audiēbant", @aFourth.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audiam", @aFourth.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("audiēs", @aFourth.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("audiet", @aFourth.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("audiēmus", @aFourth.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("audiētis", @aFourth.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("audient", @aFourth.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audīvī", @aFourth.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīvistī", @aFourth.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audīvit", @aFourth.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīvimus", @aFourth.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīvistis", @aFourth.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audīvērunt", @aFourth.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audīveram", @aFourth.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīverās", @aFourth.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audīverat", @aFourth.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīverāmus", @aFourth.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīverātis", @aFourth.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audīverant", @aFourth.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audīverō", @aFourth.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīveris", @aFourth.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audīverit", @aFourth.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīverimus", @aFourth.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīveritis", @aFourth.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audīverint", @aFourth.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive Present | |
+ | |
+ assert_equal("audior", @aFourth.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīris", @aFourth.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("audītur", @aFourth.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīmur", @aFourth.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīminī", @aFourth.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("audiuntur", @aFourth.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audiēbār", @aFourth.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audiēbāris", @aFourth.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audiēbātur", @aFourth.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audiēbāmur", @aFourth.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audiēbāminī", @aFourth.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audiēbāntur", @aFourth.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audiar", @aFourth.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("audiēris", @aFourth.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("audiētur", @aFourth.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("audiēmur", @aFourth.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("audiēminī", @aFourth.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("audientur", @aFourth.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive perfect | |
+ assert_equal("auditum sum", @aFourth.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("auditum es", @aFourth.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("auditum est", @aFourth.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("auditum sumus", @aFourth.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("auditum estis", @aFourth.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("auditum sunt", @aFourth.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("auditum eram", @aFourth.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("auditum erās", @aFourth.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("auditum erat", @aFourth.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("auditum erāmus", @aFourth.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("auditum erātis", @aFourth.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("auditum erant", @aFourth.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("auditum erō", @aFourth.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("auditum eris", @aFourth.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("auditum erit", @aFourth.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("auditum erimus", @aFourth.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("auditum eritis", @aFourth.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("auditum erint", @aFourth.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ ### Subjunctives | |
+ # Active | |
+ assert_equal("audiam", @aFourth.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("audiās", @aFourth.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("audiat", @aFourth.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("audiāmus", @aFourth.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("audiātis", @aFourth.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("audiant", @aFourth.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audīrem", @aFourth.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīres", @aFourth.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audīret", @aFourth.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīremus", @aFourth.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīretis", @aFourth.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audīrent", @aFourth.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audīverim", @aFourth.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīverīs", @aFourth.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audīverit", @aFourth.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīverīmus", @aFourth.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīverītis", @aFourth.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audīverint", @aFourth.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audīvissem", @aFourth.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīvissēs", @aFourth.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audīvisset", @aFourth.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīvissēmus", @aFourth.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīvissētis", @aFourth.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audīvissent", @aFourth.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ #passive | |
+ assert_equal("audiar", @aFourth.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("audiāris", @aFourth.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("audiātur", @aFourth.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("audiāmur", @aFourth.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("audiāminī", @aFourth.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("audiantur", @aFourth.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("audīrer", @aFourth.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("audīrēris", @aFourth.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("audīrētur", @aFourth.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("audīrēmur", @aFourth.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("audīrēminī", @aFourth.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("audīrentur", @aFourth.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ auditus, audita, auditum ] sim", @aFourth.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ auditus, audita, auditum ] sis", @aFourth.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ auditus, audita, auditum ] sit", @aFourth.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ auditī, auditae, audita ] simus", @aFourth.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ auditī, auditae, audita ] sitis", @aFourth.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ auditī, auditae, audita ] sint", @aFourth.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ auditus, audita, auditum ] essem", @aFourth.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ auditus, audita, auditum ] essēs", @aFourth.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ auditus, audita, auditum ] esset", @aFourth.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ auditī, auditae, audita ] essēmus", @aFourth.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ auditī, auditae, audita ] essētis", @aFourth.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ auditī, auditae, audita ] essent", @aFourth.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Imperatives | |
+ assert_equal("audī", @aFourth.imperatives[0].to_s) | |
+ assert_equal("audīte", @aFourth.imperatives[1].to_s) | |
+ | |
+ # Participles | |
+ assert_equal("audiēns, audientis", @aFourth.present_active_participle ) | |
+ assert_equal("auditūrus, auditūra, auditūrum", @aFourth.future_active_participle) | |
+ assert_equal("auditus, audita, auditum", @aFourth.perfect_passive_participle) | |
+ assert_equal("audiendus, audienda, audiendum", @aFourth.future_passive_participle) | |
+ | |
+ # Infinitves | |
+ assert_equal("audīre", @aFourth.present_active_infinitive.to_s) | |
+ assert_equal("audīvīsse", @aFourth.perfect_active_infinitive) | |
+ assert_equal("auditūrus esse", @aFourth.future_active_infinitive) | |
+ assert_equal("audīrī", @aFourth.present_passive_infinitive) | |
+ assert_equal("auditus, audita, auditum esse", @aFourth.perfect_passive_infinitive) | |
+ end | |
end | |
diff --git a/tests/la/second_conjugation.tests.rb b/tests/la/second_conjugation.tests.rb | |
index 8a1a746..f6c7ba6 100755 | |
--- a/tests/la/second_conjugation.tests.rb | |
+++ b/tests/la/second_conjugation.tests.rb | |
@@ -15,7 +15,7 @@ end | |
require 'linguistics' | |
### This test case tests ... | |
-class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+class LatinVerbSecondConjugationTestCase < Linguistics::TestCase | |
def initialize( *args ) | |
super | |
@@ -25,8 +25,184 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
def test_0000_loaded | |
assert_respond_to Linguistics::LA, :razzle | |
end | |
+ def setup | |
+ @aSecond = Latin::LatinVerb.new %w(moneō monēre monuī monitum) | |
+ | |
+ end | |
+ | |
+ def test_display_call | |
+ assert_nothing_raised(RuntimeError) { | |
+ @aSecond.full_conjugation | |
+ @aSecond.display_full_listing | |
+ } | |
+ end | |
+ | |
+ def test_exhaustive | |
+ assert_equal("moneō", @aSecond.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("monēs", @aSecond.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("monet", @aSecond.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("monēmus", @aSecond.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("monētis", @aSecond.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("monent", @aSecond.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monēbam", @aSecond.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monēbās", @aSecond.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monēbat", @aSecond.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monēbāmus", @aSecond.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monēbātis", @aSecond.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monēbant", @aSecond.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monēbō", @aSecond.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("monēbis", @aSecond.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("monēbit", @aSecond.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("monēbimus", @aSecond.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("monēbitis", @aSecond.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("monēbunt", @aSecond.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monuī", @aSecond.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monuistī", @aSecond.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monuit", @aSecond.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monuimus", @aSecond.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monuistis", @aSecond.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monuērunt", @aSecond.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monueram", @aSecond.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monuerās", @aSecond.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monuerat", @aSecond.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monuerāmus", @aSecond.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monuerātis", @aSecond.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monuerant", @aSecond.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monuerō", @aSecond.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monueris", @aSecond.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monuerit", @aSecond.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monuerimus", @aSecond.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monueritis", @aSecond.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monuerint", @aSecond.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive Present | |
+ | |
+ assert_equal("moneor", @aSecond.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("monēris", @aSecond.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("monētur", @aSecond.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("monēmur", @aSecond.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("monēminī", @aSecond.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("monentur", @aSecond.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monēbar", @aSecond.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monēbāris", @aSecond.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monēbātur", @aSecond.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monēbāmur", @aSecond.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monēbāminī", @aSecond.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monēbantur", @aSecond.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monēbor", @aSecond.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("monēberis", @aSecond.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("monēbitur", @aSecond.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("monēbimur", @aSecond.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("monēbiminī", @aSecond.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("monēbuntur", @aSecond.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive perfect | |
+ assert_equal("monitum sum", @aSecond.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monitum es", @aSecond.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monitum est", @aSecond.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monitum sumus", @aSecond.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monitum estis", @aSecond.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monitum sunt", @aSecond.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monitum eram", @aSecond.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monitum erās", @aSecond.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monitum erat", @aSecond.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monitum erāmus", @aSecond.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monitum erātis", @aSecond.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monitum erant", @aSecond.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monitum erō", @aSecond.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monitum eris", @aSecond.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monitum erit", @aSecond.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monitum erimus", @aSecond.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monitum eritis", @aSecond.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monitum erint", @aSecond.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ ### Subjunctives | |
+ # Active | |
+ assert_equal("moneam", @aSecond.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("moneās", @aSecond.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("moneat", @aSecond.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("moneāmus", @aSecond.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("moneātis", @aSecond.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("moneant", @aSecond.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monērem", @aSecond.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monēres", @aSecond.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monēret", @aSecond.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monēremus", @aSecond.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monēretis", @aSecond.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monērent", @aSecond.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monuerim", @aSecond.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monuerīs", @aSecond.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monuerit", @aSecond.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monuerīmus", @aSecond.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monuerītis", @aSecond.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monuerint", @aSecond.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monuissem", @aSecond.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monuissēs", @aSecond.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monuisset", @aSecond.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monuissēmus", @aSecond.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monuissētis", @aSecond.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monuissent", @aSecond.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ #passive | |
+ assert_equal("monear", @aSecond.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("moneāris", @aSecond.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("moneātur", @aSecond.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("moneāmur", @aSecond.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("moneāminī", @aSecond.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("moneantur", @aSecond.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("monērer", @aSecond.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("monērēris", @aSecond.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("monērētur", @aSecond.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("monērēmur", @aSecond.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("monērēminī", @aSecond.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("monērentur", @aSecond.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ monitus, monita, monitum ] sim", @aSecond.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ monitus, monita, monitum ] sis", @aSecond.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ monitus, monita, monitum ] sit", @aSecond.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ monitī, monitae, monita ] simus", @aSecond.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ monitī, monitae, monita ] sitis", @aSecond.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ monitī, monitae, monita ] sint", @aSecond.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ monitus, monita, monitum ] essem", @aSecond.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ monitus, monita, monitum ] essēs", @aSecond.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ monitus, monita, monitum ] esset", @aSecond.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ monitī, monitae, monita ] essēmus", @aSecond.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ monitī, monitae, monita ] essētis", @aSecond.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ monitī, monitae, monita ] essent", @aSecond.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Imperatives | |
+ assert_equal("monē", @aSecond.imperatives[0].to_s) | |
+ assert_equal("monēte", @aSecond.imperatives[1].to_s) | |
+ | |
+ # Participles | |
+ assert_equal("monēns, monentis", @aSecond.present_active_participle ) | |
+ assert_equal("monitūrus, monitūra, monitūrum", @aSecond.future_active_participle) | |
+ assert_equal("monitus, monita, monitum", @aSecond.perfect_passive_participle) | |
+ assert_equal("monendus, monenda, monendum", @aSecond.future_passive_participle) | |
+ | |
+ # Infinitves | |
+ assert_equal("monēre", @aSecond.present_active_infinitive.to_s) | |
+ assert_equal("monuīsse", @aSecond.perfect_active_infinitive) | |
+ assert_equal("monitūrus esse", @aSecond.future_active_infinitive) | |
+ assert_equal("monērī", @aSecond.present_passive_infinitive) | |
+ assert_equal("monitus, monita, monitum esse", @aSecond.perfect_passive_infinitive) | |
+ end | |
+ | |
- def test_first_conjugation | |
end | |
diff --git a/tests/la/testLatinVerb.rb b/tests/la/testLatinVerb.rb | |
new file mode 100755 | |
index 0000000..fad283f | |
--- /dev/null | |
+++ b/tests/la/testLatinVerb.rb | |
@@ -0,0 +1,71 @@ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+require "test/unit" | |
+require "linguistics/la/LatinVerb" | |
+ | |
+class TestLatinVerb < Test::Unit::TestCase | |
+ def setup | |
+ @tLV1st = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
+ @tLV2nd = Latin::LatinVerb.new %w(moneō monēre monvī monitum) | |
+ @tLV3rd = Latin::LatinVerb.new %w(agō agere ēgī actum) | |
+ @tLV3IO = Latin::LatinVerb.new %w(capiō capere cēpī captum) | |
+ @tLV4th = Latin::LatinVerb.new %w(audiō audīre audīvī auditum) | |
+ end | |
+ | |
+ def teardown | |
+ tLV1st = tLV2nd = tLV3rd = tLV3IO = tLV4th = nil | |
+ end | |
+ | |
+ def test_basics | |
+ assert_equal(4, @tLV1st.four_pp.length) | |
+ assert_equal("Latin::LatinWord", @tLV1st.four_pp[3].class.to_s) | |
+ | |
+ # Test conjugation correctness | |
+ assert_equal("1", @tLV1st.conjugation) | |
+ assert_equal("2", @tLV2nd.conjugation) | |
+ assert_equal("3", @tLV3rd.conjugation) | |
+ assert_equal("3IO", @tLV3IO.conjugation) | |
+ assert_equal("4", @tLV4th.conjugation) | |
+ end | |
+ | |
+ def test_basic_retrieval1 | |
+ latTense = @tLV1st.active_voice_subjunctive_mood_pastperfect_tense.pop | |
+ assert_equal(6,latTense.aggregate_nodes.length) | |
+ assert_equal("amāvissēmus",latTense.aggregate_nodes[3].to_s) | |
+ end | |
+ | |
+ def test_basic_retrieval2 | |
+ assert_equal("amāvissent", @tLV1st.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ end | |
+ | |
+ def test_basic_retrieval3 | |
+ assert_equal("amāvisset, amāvissent", | |
+ @tLV1st.active_voice_subjunctive_mood_pastperfect_tense_third_person[0]) | |
+ end | |
+ | |
+ def test_basic_retrieval4 | |
+ assert_equal("amāvissem, amāvissēs, amāvisset", | |
+ @tLV1st.active_voice_subjunctive_mood_pastperfect_tense_singular_number[0]) | |
+ end | |
+ | |
+ def test_full_listing | |
+ @tLV1st = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
+ @tLV1st.full_conjugation | |
+ @tLV1st.display_full_listing | |
+ end | |
+ | |
+ def test_validity_check | |
+ assert_raise(RuntimeError) { @deponent = Latin::LatinVerb.new ["hortor", "hortārī", "hortātus sum"] } | |
+ assert_raise(RuntimeError) { @semideponent = Latin::LatinVerb.new ["gaudeō", "gaudēre", "gāvīsus sum"] } | |
+ assert_raise(RuntimeError) { @irregular_esse = Latin::LatinVerb.new %w(sum esse fuī futūrum) } | |
+ assert_raise(RuntimeError) { @irregular_nolo = Latin::LatinVerb.new %w(nōlō nōlle nōluī) } | |
+ end | |
+ | |
+end | |
+ | |
diff --git a/tests/la/testLatinWord.rb b/tests/la/testLatinWord.rb | |
new file mode 100755 | |
index 0000000..8d7cb20 | |
--- /dev/null | |
+++ b/tests/la/testLatinWord.rb | |
@@ -0,0 +1,32 @@ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+require "test/unit" | |
+require "linguistics/la/LatinWord" | |
+ | |
+class TestLatinWord < Test::Unit::TestCase | |
+ def initialize( *args ) | |
+ super | |
+ Linguistics::use( :la ) | |
+ end | |
+ | |
+ def test_case_name | |
+ k=Latin::LatinWord.new("tezzzōaestēixēndyzēntpdqō1234568īm") | |
+ | |
+ # Make sure assignment worked | |
+ assert_not_nil(k) | |
+ | |
+ # Make sure the macron rules were enforced | |
+ assert_equal('o',k[5]) | |
+ assert_equal('i',k[k.length-2]) | |
+ | |
+ | |
+ flunk("Should have found multibyte") unless k.multibyte? | |
+ | |
+ end | |
+end | |
\ No newline at end of file | |
diff --git a/tests/la/testSuite.rb b/tests/la/testSuite.rb | |
new file mode 100755 | |
index 0000000..ea1307a | |
--- /dev/null | |
+++ b/tests/la/testSuite.rb | |
@@ -0,0 +1,45 @@ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+require 'test/unit/testsuite' | |
+require 'test/unit/ui/console/testrunner' | |
+require 'testLatinWord' | |
+require 'testUnicodeSafeString' | |
+require 'testTenseBlock' | |
+require 'testLatinVerb' | |
+require 'first_conjugation.tests' | |
+require 'second_conjugation.tests' | |
+require 'third_conjugation.tests' | |
+require 'third-io_conjugation.tests' | |
+require 'fourth_conjugation.tests' | |
+ | |
+ | |
+class TS_MyTests | |
+ | |
+ def initialize( *args ) | |
+ super | |
+ Linguistics::use( :la ) | |
+ end | |
+ | |
+ def self.suite | |
+ suite = Test::Unit::TestSuite.new | |
+ suite << TestUnicodeSafeString.suite | |
+ suite << TestLatinWord.suite | |
+ suite << TestLanguageTenseBlock.suite | |
+ suite << TestLatinVerb.suite | |
+ suite << LatinVerbFirstConjugationTestCase.suite | |
+ suite << LatinVerbSecondConjugationTestCase.suite | |
+ suite << LatinVerbThirdConjugationTestCase.suite | |
+ suite << LatinVerbThirdIOConjugationTestCase.suite | |
+ suite << LatinVerbFourthConjugationTestCase.suite | |
+ return suite | |
+ end | |
+end | |
+ | |
+Test::Unit::UI::Console::TestRunner.run(TS_MyTests) | |
diff --git a/tests/la/testTenseBlock.rb b/tests/la/testTenseBlock.rb | |
new file mode 100755 | |
index 0000000..055d511 | |
--- /dev/null | |
+++ b/tests/la/testTenseBlock.rb | |
@@ -0,0 +1,33 @@ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+require "test/unit" | |
+require "linguistics/language/TenseBlock" | |
+ | |
+class TestLanguageTenseBlock < Test::Unit::TestCase | |
+ def test_case_name | |
+ j=TenseBlock.new( { | |
+ :boundaries => 'persons by numbers', | |
+ :numbers => %w(Singular Plural), | |
+ :persons => %w(First Second Third), | |
+ :tense => 'present', | |
+ } | |
+ ) | |
+ #j.to_s #=> array of all the names, create_matrix called implicitly | |
+ assert_equal("foo".class, j.to_s.class) | |
+ | |
+ # Iterate over the values that build the matrix of names | |
+ # j.create_matrix{|x| puts x } | |
+ | |
+ # Override the default wrapping lambda | |
+ #j.create_matrix( lambda { |x,y| "<<#{x}++#{y}>>" } ){|x| puts x } | |
+ | |
+ #puts j.matrix | |
+ | |
+ end | |
+end | |
\ No newline at end of file | |
diff --git a/tests/la/testUnicodeSafeString.rb b/tests/la/testUnicodeSafeString.rb | |
new file mode 100755 | |
index 0000000..ed45b4a | |
--- /dev/null | |
+++ b/tests/la/testUnicodeSafeString.rb | |
@@ -0,0 +1,52 @@ | |
+#!/usr/bin/env ruby | |
+ | |
+unless defined? Linguistics::TestCase | |
+ testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) ) | |
+ $LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir ) | |
+ require 'lingtestcase' | |
+end | |
+ | |
+require 'linguistics' | |
+ | |
+require 'linguistics/language/MacronConversions' | |
+require 'linguistics/unicode/SGHUnicode' | |
+require 'test/unit' | |
+ | |
+class TestUnicodeSafeString < Test::Unit::TestCase | |
+ def setup | |
+ # Setup | |
+ @testString=SGHUnicode::UnicodeSafeString.new("laudāre") | |
+ @reverseString=SGHUnicode::UnicodeSafeString.new("monuī") | |
+ end | |
+ | |
+ def test_simple | |
+ #Basic assignment test | |
+ nullConstructor=SGHUnicode::UnicodeSafeString.new | |
+ nullConstructor="foo" | |
+ assert_equal("foo",nullConstructor) | |
+ | |
+ # Verify assignment / length / selected characters | |
+ assert_equal("laudāre", @testString.to_s) | |
+ assert_equal(7, @testString.length) | |
+ assert_equal("d", @testString[3]) | |
+ assert_equal("ā", @testString[4]) | |
+ | |
+ | |
+ # Test simple ranges | |
+ assert_equal("la", @testString[0..1]) | |
+ assert_equal("re", @testString[-2..-1]) | |
+ | |
+ # Test out of bound condition | |
+ | |
+ assert_raise(RuntimeError){ @testString[300] } | |
+ assert_raise(RuntimeError){ @testString[5..90] } | |
+ assert_raise(RuntimeError){ @testString[-20..-10] } | |
+ | |
+ # Test reverse, overridden from String | |
+ assert_equal("erādual",@testString.reverse) | |
+ end | |
+ | |
+ def test_reverse | |
+ assert_equal("īunom", @reverseString.reverse.to_s) | |
+ end | |
+end | |
\ No newline at end of file | |
diff --git a/tests/la/third-io_conjugation.tests.rb b/tests/la/third-io_conjugation.tests.rb | |
index 8a1a746..e4de632 100755 | |
--- a/tests/la/third-io_conjugation.tests.rb | |
+++ b/tests/la/third-io_conjugation.tests.rb | |
@@ -15,7 +15,7 @@ end | |
require 'linguistics' | |
### This test case tests ... | |
-class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+class LatinVerbThirdIOConjugationTestCase < Linguistics::TestCase | |
def initialize( *args ) | |
super | |
@@ -26,7 +26,183 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
assert_respond_to Linguistics::LA, :razzle | |
end | |
- def test_first_conjugation | |
+ def setup | |
+ @aThirdIO = Latin::LatinVerb.new %w(capiō capere cēpī captum) | |
+ | |
+ end | |
+ | |
+ def test_display_call | |
+ assert_nothing_raised(RuntimeError) { | |
+ @aThirdIO.full_conjugation | |
+ @aThirdIO.display_full_listing | |
+ } | |
+ end | |
+ | |
+ def test_exhaustive | |
+ assert_equal("capiō", @aThirdIO.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("capis", @aThirdIO.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("capit", @aThirdIO.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("capimus", @aThirdIO.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("capitis", @aThirdIO.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("capiunt", @aThirdIO.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("capiēbam", @aThirdIO.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("capiēbās", @aThirdIO.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("capiēbat", @aThirdIO.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("capiēbāmus", @aThirdIO.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("capiēbātis", @aThirdIO.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("capiēbant", @aThirdIO.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("capiam", @aThirdIO.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("capiēs", @aThirdIO.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("capiet", @aThirdIO.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("capiēmus", @aThirdIO.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("capiētis", @aThirdIO.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("capient", @aThirdIO.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("cēpī", @aThirdIO.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("cēpistī", @aThirdIO.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("cēpit", @aThirdIO.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("cēpimus", @aThirdIO.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("cēpistis", @aThirdIO.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("cēpērunt", @aThirdIO.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("cēperam", @aThirdIO.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("cēperās", @aThirdIO.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("cēperat", @aThirdIO.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("cēperāmus", @aThirdIO.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("cēperātis", @aThirdIO.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("cēperant", @aThirdIO.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("cēperō", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("cēperis", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("cēperit", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("cēperimus", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("cēperitis", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("cēperint", @aThirdIO.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive Present | |
+ | |
+ assert_equal("capior", @aThirdIO.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("caperis", @aThirdIO.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("capitur", @aThirdIO.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("capimur", @aThirdIO.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("capiminī", @aThirdIO.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("capiuntur", @aThirdIO.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("capiēbār", @aThirdIO.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("capiēbāris", @aThirdIO.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("capiēbātur", @aThirdIO.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("capiēbāmur", @aThirdIO.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("capiēbāminī", @aThirdIO.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("capiēbāntur", @aThirdIO.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("capiar", @aThirdIO.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("capiēris", @aThirdIO.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("capiētur", @aThirdIO.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("capiēmur", @aThirdIO.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("capiēminī", @aThirdIO.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("capientur", @aThirdIO.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive perfect | |
+ assert_equal("captum sum", @aThirdIO.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("captum es", @aThirdIO.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("captum est", @aThirdIO.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("captum sumus", @aThirdIO.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("captum estis", @aThirdIO.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("captum sunt", @aThirdIO.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("captum eram", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("captum erās", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("captum erat", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("captum erāmus", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("captum erātis", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("captum erant", @aThirdIO.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("captum erō", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("captum eris", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("captum erit", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("captum erimus", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("captum eritis", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("captum erint", @aThirdIO.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ ### Subjunctives | |
+ # Active | |
+ assert_equal("capiam", @aThirdIO.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("capiās", @aThirdIO.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("capiat", @aThirdIO.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("capiāmus", @aThirdIO.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("capiātis", @aThirdIO.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("capiant", @aThirdIO.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("caperem", @aThirdIO.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("caperes", @aThirdIO.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("caperet", @aThirdIO.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("caperemus", @aThirdIO.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("caperetis", @aThirdIO.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("caperent", @aThirdIO.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("cēperim", @aThirdIO.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("cēperīs", @aThirdIO.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("cēperit", @aThirdIO.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("cēperīmus", @aThirdIO.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("cēperītis", @aThirdIO.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("cēperint", @aThirdIO.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("cēpissem", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("cēpissēs", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("cēpisset", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("cēpissēmus", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("cēpissētis", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("cēpissent", @aThirdIO.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ #passive | |
+ assert_equal("capiar", @aThirdIO.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("capiāris", @aThirdIO.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("capiātur", @aThirdIO.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("capiāmur", @aThirdIO.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("capiāminī", @aThirdIO.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("capiantur", @aThirdIO.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("caperer", @aThirdIO.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("caperēris", @aThirdIO.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("caperētur", @aThirdIO.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("caperēmur", @aThirdIO.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("caperēminī", @aThirdIO.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("caperentur", @aThirdIO.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ captus, capta, captum ] sim", @aThirdIO.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ captus, capta, captum ] sis", @aThirdIO.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ captus, capta, captum ] sit", @aThirdIO.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ captī, captae, capta ] simus", @aThirdIO.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ captī, captae, capta ] sitis", @aThirdIO.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ captī, captae, capta ] sint", @aThirdIO.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ captus, capta, captum ] essem", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ captus, capta, captum ] essēs", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ captus, capta, captum ] esset", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ captī, captae, capta ] essēmus", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ captī, captae, capta ] essētis", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ captī, captae, capta ] essent", @aThirdIO.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Imperatives | |
+ assert_equal("cape", @aThirdIO.imperatives[0].to_s) | |
+ assert_equal("capite", @aThirdIO.imperatives[1].to_s) | |
+ | |
+ # Participles | |
+ assert_equal("capiēns, capientis", @aThirdIO.present_active_participle ) | |
+ assert_equal("captūrus, captūra, captūrum", @aThirdIO.future_active_participle) | |
+ assert_equal("captus, capta, captum", @aThirdIO.perfect_passive_participle) | |
+ assert_equal("capiendus, capienda, capiendum", @aThirdIO.future_passive_participle) | |
+ | |
+ # Infinitves | |
+ assert_equal("capere", @aThirdIO.present_active_infinitive.to_s) | |
+ assert_equal("cēpīsse", @aThirdIO.perfect_active_infinitive) | |
+ assert_equal("captūrus esse", @aThirdIO.future_active_infinitive) | |
+ assert_equal("capī", @aThirdIO.present_passive_infinitive) | |
+ assert_equal("captus, capta, captum esse", @aThirdIO.perfect_passive_infinitive) | |
+ end | |
+ | |
end | |
diff --git a/tests/la/third_conjugation.tests.rb b/tests/la/third_conjugation.tests.rb | |
index 8a1a746..8e35f21 100755 | |
--- a/tests/la/third_conjugation.tests.rb | |
+++ b/tests/la/third_conjugation.tests.rb | |
@@ -15,7 +15,7 @@ end | |
require 'linguistics' | |
### This test case tests ... | |
-class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
+class LatinVerbThirdConjugationTestCase < Linguistics::TestCase | |
def initialize( *args ) | |
super | |
@@ -26,7 +26,182 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
assert_respond_to Linguistics::LA, :razzle | |
end | |
- def test_first_conjugation | |
+ def setup | |
+ @aThird = Latin::LatinVerb.new %w(agō agere ēgī actum) | |
+ | |
+ end | |
+ | |
+ def test_display_call | |
+ assert_nothing_raised(RuntimeError) { | |
+ @aThird.full_conjugation | |
+ @aThird.display_full_listing | |
+ } | |
+ end | |
+ | |
+ def test_exhaustive | |
+ assert_equal("ago", @aThird.active_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("agis", @aThird.active_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("agit", @aThird.active_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("agimus", @aThird.active_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("agitis", @aThird.active_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("agunt", @aThird.active_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("agēbam", @aThird.active_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("agēbās", @aThird.active_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("agēbat", @aThird.active_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("agēbāmus", @aThird.active_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("agēbātis", @aThird.active_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("agēbant", @aThird.active_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("agam", @aThird.active_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("agēs", @aThird.active_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("aget", @aThird.active_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("agēmus", @aThird.active_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("agētis", @aThird.active_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("agent", @aThird.active_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("ēgī", @aThird.active_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("ēgistī", @aThird.active_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("ēgit", @aThird.active_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("ēgimus", @aThird.active_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("ēgistis", @aThird.active_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("ēgērunt", @aThird.active_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("ēgeram", @aThird.active_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("ēgerās", @aThird.active_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("ēgerat", @aThird.active_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("ēgerāmus", @aThird.active_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("ēgerātis", @aThird.active_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("ēgerant", @aThird.active_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("ēgerō", @aThird.active_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("ēgeris", @aThird.active_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("ēgerit", @aThird.active_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("ēgerimus", @aThird.active_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("ēgeritis", @aThird.active_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("ēgerint", @aThird.active_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive Present | |
+ | |
+ assert_equal("agor", @aThird.passive_voice_indicative_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("ageris", @aThird.passive_voice_indicative_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("agitur", @aThird.passive_voice_indicative_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("agimur", @aThird.passive_voice_indicative_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("agiminī", @aThird.passive_voice_indicative_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("aguntur", @aThird.passive_voice_indicative_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("agēbār", @aThird.passive_voice_indicative_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("agēbāris", @aThird.passive_voice_indicative_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("agēbātur", @aThird.passive_voice_indicative_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("agēbāmur", @aThird.passive_voice_indicative_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("agēbāminī", @aThird.passive_voice_indicative_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("agēbāntur", @aThird.passive_voice_indicative_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("agar", @aThird.passive_voice_indicative_mood_future_tense_first_person_singular_number.to_s) | |
+ assert_equal("agēris", @aThird.passive_voice_indicative_mood_future_tense_second_person_singular_number.to_s) | |
+ assert_equal("agētur", @aThird.passive_voice_indicative_mood_future_tense_third_person_singular_number.to_s) | |
+ assert_equal("agēmur", @aThird.passive_voice_indicative_mood_future_tense_first_person_plural_number.to_s) | |
+ assert_equal("agēminī", @aThird.passive_voice_indicative_mood_future_tense_second_person_plural_number.to_s) | |
+ assert_equal("agentur", @aThird.passive_voice_indicative_mood_future_tense_third_person_plural_number.to_s) | |
+ | |
+ # Passive perfect | |
+ assert_equal("actum sum", @aThird.passive_voice_indicative_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("actum es", @aThird.passive_voice_indicative_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("actum est", @aThird.passive_voice_indicative_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("actum sumus", @aThird.passive_voice_indicative_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("actum estis", @aThird.passive_voice_indicative_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("actum sunt", @aThird.passive_voice_indicative_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("actum eram", @aThird.passive_voice_indicative_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("actum erās", @aThird.passive_voice_indicative_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("actum erat", @aThird.passive_voice_indicative_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("actum erāmus", @aThird.passive_voice_indicative_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("actum erātis", @aThird.passive_voice_indicative_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("actum erant", @aThird.passive_voice_indicative_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("actum erō", @aThird.passive_voice_indicative_mood_futureperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("actum eris", @aThird.passive_voice_indicative_mood_futureperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("actum erit", @aThird.passive_voice_indicative_mood_futureperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("actum erimus", @aThird.passive_voice_indicative_mood_futureperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("actum eritis", @aThird.passive_voice_indicative_mood_futureperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("actum erint", @aThird.passive_voice_indicative_mood_futureperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ ### Subjunctives | |
+ # Active | |
+ assert_equal("agam", @aThird.active_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("agās", @aThird.active_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("agat", @aThird.active_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("agāmus", @aThird.active_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("agātis", @aThird.active_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("agant", @aThird.active_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("agerem", @aThird.active_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("ageres", @aThird.active_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("ageret", @aThird.active_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("ageremus", @aThird.active_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("ageretis", @aThird.active_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("agerent", @aThird.active_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("ēgerim", @aThird.active_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("ēgerīs", @aThird.active_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("ēgerit", @aThird.active_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("ēgerīmus", @aThird.active_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("ēgerītis", @aThird.active_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("ēgerint", @aThird.active_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("ēgissem", @aThird.active_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("ēgissēs", @aThird.active_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("ēgisset", @aThird.active_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("ēgissēmus", @aThird.active_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("ēgissētis", @aThird.active_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("ēgissent", @aThird.active_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ #passive | |
+ assert_equal("agar", @aThird.passive_voice_subjunctive_mood_present_tense_first_person_singular_number.to_s) | |
+ assert_equal("agāris", @aThird.passive_voice_subjunctive_mood_present_tense_second_person_singular_number.to_s) | |
+ assert_equal("agātur", @aThird.passive_voice_subjunctive_mood_present_tense_third_person_singular_number.to_s) | |
+ assert_equal("agāmur", @aThird.passive_voice_subjunctive_mood_present_tense_first_person_plural_number.to_s) | |
+ assert_equal("agāminī", @aThird.passive_voice_subjunctive_mood_present_tense_second_person_plural_number.to_s) | |
+ assert_equal("agantur", @aThird.passive_voice_subjunctive_mood_present_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("agerer", @aThird.passive_voice_subjunctive_mood_imperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("agerēris", @aThird.passive_voice_subjunctive_mood_imperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("agerētur", @aThird.passive_voice_subjunctive_mood_imperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("agerēmur", @aThird.passive_voice_subjunctive_mood_imperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("agerēminī", @aThird.passive_voice_subjunctive_mood_imperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("agerentur", @aThird.passive_voice_subjunctive_mood_imperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ actus, acta, actum ] sim", @aThird.passive_voice_subjunctive_mood_perfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ actus, acta, actum ] sis", @aThird.passive_voice_subjunctive_mood_perfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ actus, acta, actum ] sit", @aThird.passive_voice_subjunctive_mood_perfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ actī, actae, acta ] simus", @aThird.passive_voice_subjunctive_mood_perfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ actī, actae, acta ] sitis", @aThird.passive_voice_subjunctive_mood_perfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ actī, actae, acta ] sint", @aThird.passive_voice_subjunctive_mood_perfect_tense_third_person_plural_number.to_s) | |
+ | |
+ assert_equal("[ actus, acta, actum ] essem", @aThird.passive_voice_subjunctive_mood_pastperfect_tense_first_person_singular_number.to_s) | |
+ assert_equal("[ actus, acta, actum ] essēs", @aThird.passive_voice_subjunctive_mood_pastperfect_tense_second_person_singular_number.to_s) | |
+ assert_equal("[ actus, acta, actum ] esset", @aThird.passive_voice_subjunctive_mood_pastperfect_tense_third_person_singular_number.to_s) | |
+ assert_equal("[ actī, actae, acta ] essēmus", @aThird.passive_voice_subjunctive_mood_pastperfect_tense_first_person_plural_number.to_s) | |
+ assert_equal("[ actī, actae, acta ] essētis", @aThird.passive_voice_subjunctive_mood_pastperfect_tense_second_person_plural_number.to_s) | |
+ assert_equal("[ actī, actae, acta ] essent", @aThird.passive_voice_subjunctive_mood_pastperfect_tense_third_person_plural_number.to_s) | |
+ | |
+ # Imperatives | |
+ assert_equal("age", @aThird.imperatives[0].to_s) | |
+ assert_equal("agite", @aThird.imperatives[1].to_s) | |
+ | |
+ # Participles | |
+ assert_equal("agens, agentis", @aThird.present_active_participle ) | |
+ assert_equal("actūrus, actūra, actūrum", @aThird.future_active_participle) | |
+ assert_equal("actus, acta, actum", @aThird.perfect_passive_participle) | |
+ assert_equal("agendus, agenda, agendum", @aThird.future_passive_participle) | |
+ | |
+ # Infinitves | |
+ assert_equal("agere", @aThird.present_active_infinitive.to_s) | |
+ assert_equal("ēgīsse", @aThird.perfect_active_infinitive) | |
+ assert_equal("actūrus esse", @aThird.future_active_infinitive) | |
+ assert_equal("agī", @aThird.present_passive_infinitive) | |
+ assert_equal("actus, acta, actum esse", @aThird.perfect_passive_infinitive) | |
+ end | |
end | |
-- | |
1.6.3.1 | |
From c0daa2a57d6e789dc3aa0d6795181c7442175a50 Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 17:07:56 -0500 | |
Subject: [PATCH 08/11] Added conjugate method, essential for experiment. | |
Added self as author; better test for ok load | |
--- | |
README | 3 +++ | |
lib/linguistics/la.rb | 22 ++++++++++++++++++++-- | |
tests/la/first_conjugation.tests.rb | 4 ++-- | |
tests/la/fourth_conjugation.tests.rb | 2 +- | |
tests/la/second_conjugation.tests.rb | 2 +- | |
tests/la/third-io_conjugation.tests.rb | 2 +- | |
tests/la/third_conjugation.tests.rb | 2 +- | |
7 files changed, 29 insertions(+), 8 deletions(-) | |
diff --git a/README b/README | |
index f3c3708..07c60bf 100644 | |
--- a/README | |
+++ b/README | |
@@ -5,6 +5,7 @@ | |
* Michael Granger <[email protected]> | |
* Martin Chase <[email protected]> | |
+* Steven G. Harms <[email protected]> | |
== Requirements | |
@@ -145,6 +146,8 @@ modules (which must be installed separately). | |
* Suggestions (and patches) for any of these items or additional features are | |
welcomed. | |
+* Add declination support for Latin section | |
+ | |
== Legal | |
diff --git a/lib/linguistics/la.rb b/lib/linguistics/la.rb | |
index 94ba637..f13fe39 100644 | |
--- a/lib/linguistics/la.rb | |
+++ b/lib/linguistics/la.rb | |
@@ -30,7 +30,25 @@ module Linguistics::LA | |
module_function | |
############### | |
- def razzle | |
- puts "i say razzle" | |
+=begin rdoc | |
+ | |
+Conjugate takes a string which is assumed to be the four principal parts of a | |
+Latin verb. If the verb is missing a part, as in the case of deponents or | |
+other special cases, then the character - is to be passed | |
+ | |
+The string is broken apart to form the four principal parts that are expected | |
+in the initalize routine of a LatinVerb object | |
+ | |
+=end | |
+ | |
+ def conjugate(verbString) | |
+ processed_parts = Array.new | |
+ verbString.split(/\s+/).each do |part| | |
+ ( part.to_s == "-" ) ? partprocessed_parts.push(nil) : processed_parts.push(part) | |
+ end | |
+ require 'pp' | |
+ result = Latin::LatinVerb.new(processed_parts) | |
+ result.full_conjugation | |
+ return result | |
end | |
end | |
\ No newline at end of file | |
diff --git a/tests/la/first_conjugation.tests.rb b/tests/la/first_conjugation.tests.rb | |
index aaa4bd1..2f1fb16 100755 | |
--- a/tests/la/first_conjugation.tests.rb | |
+++ b/tests/la/first_conjugation.tests.rb | |
@@ -23,11 +23,11 @@ class LatinVerbFirstConjugationTestCase < Linguistics::TestCase | |
end | |
def test_0000_loaded | |
- assert_respond_to Linguistics::LA, :razzle | |
+ assert_respond_to Linguistics::LA, :conjugate | |
end | |
def setup | |
- @aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
+ @aFirst = Latin::LatinVerb.new %w(amō amāre amāvī amatum) | |
raise RuntimeException unless @aFirst | |
end | |
diff --git a/tests/la/fourth_conjugation.tests.rb b/tests/la/fourth_conjugation.tests.rb | |
index 544b07d..5f19f78 100755 | |
--- a/tests/la/fourth_conjugation.tests.rb | |
+++ b/tests/la/fourth_conjugation.tests.rb | |
@@ -23,7 +23,7 @@ class LatinVerbFourthConjugationTestCase < Linguistics::TestCase | |
end | |
def test_0000_loaded | |
- assert_respond_to Linguistics::LA, :razzle | |
+ assert_respond_to Linguistics::LA, :conjugate | |
end | |
def setup | |
diff --git a/tests/la/second_conjugation.tests.rb b/tests/la/second_conjugation.tests.rb | |
index f6c7ba6..acb9165 100755 | |
--- a/tests/la/second_conjugation.tests.rb | |
+++ b/tests/la/second_conjugation.tests.rb | |
@@ -23,7 +23,7 @@ class LatinVerbSecondConjugationTestCase < Linguistics::TestCase | |
end | |
def test_0000_loaded | |
- assert_respond_to Linguistics::LA, :razzle | |
+ assert_respond_to Linguistics::LA, :conjugate | |
end | |
def setup | |
@aSecond = Latin::LatinVerb.new %w(moneō monēre monuī monitum) | |
diff --git a/tests/la/third-io_conjugation.tests.rb b/tests/la/third-io_conjugation.tests.rb | |
index e4de632..45c43cb 100755 | |
--- a/tests/la/third-io_conjugation.tests.rb | |
+++ b/tests/la/third-io_conjugation.tests.rb | |
@@ -23,7 +23,7 @@ class LatinVerbThirdIOConjugationTestCase < Linguistics::TestCase | |
end | |
def test_0000_loaded | |
- assert_respond_to Linguistics::LA, :razzle | |
+ assert_respond_to Linguistics::LA, :conjugate | |
end | |
def setup | |
diff --git a/tests/la/third_conjugation.tests.rb b/tests/la/third_conjugation.tests.rb | |
index 8e35f21..a97bd08 100755 | |
--- a/tests/la/third_conjugation.tests.rb | |
+++ b/tests/la/third_conjugation.tests.rb | |
@@ -23,7 +23,7 @@ class LatinVerbThirdConjugationTestCase < Linguistics::TestCase | |
end | |
def test_0000_loaded | |
- assert_respond_to Linguistics::LA, :razzle | |
+ assert_respond_to Linguistics::LA, :conjugate | |
end | |
def setup | |
-- | |
1.6.3.1 | |
From f2bb8643c3932662e83dd1a0e889d1b5cca89a87 Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 17:10:33 -0500 | |
Subject: [PATCH 09/11] Added a demonstration script. | |
--- | |
experiments/latin_experiment.rb | 23 +++++++++++++++++++++++ | |
1 files changed, 23 insertions(+), 0 deletions(-) | |
create mode 100755 experiments/latin_experiment.rb | |
diff --git a/experiments/latin_experiment.rb b/experiments/latin_experiment.rb | |
new file mode 100755 | |
index 0000000..ef1a588 | |
--- /dev/null | |
+++ b/experiments/latin_experiment.rb | |
@@ -0,0 +1,23 @@ | |
+#!/usr/bin/ruby | |
+ | |
+BEGIN { | |
+ $LOAD_PATH.unshift File::dirname(File::dirname( __FILE__ )) + "/lib" | |
+ require 'linguistics' | |
+} | |
+ | |
+Linguistics::use( :la ) | |
+ | |
+def divider | |
+ 79.times{print "#"} | |
+ print "\n" | |
+end | |
+ | |
+aFirstConjugationVerbLatinVerb = "amō amāre amāvī amatum".la.conjugate | |
+ | |
+aFirstConjugationVerbLatinVerb.display_full_listing #=> Prints pretty chart to the screen | |
+divider | |
+puts aFirstConjugationVerbLatinVerb.active_voice_indicative_mood_perfect_tense_first_person_plural_number | |
+divider | |
+# Empty the collections cache | |
+aFirstConjugationVerbLatinVerb.collections.shift | |
+puts aFirstConjugationVerbLatinVerb.active_voice_indicative_mood_imperfect_tense | |
-- | |
1.6.3.1 | |
From 41507c52e29a32e7944283c4936701ff887513de Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 17:20:42 -0500 | |
Subject: [PATCH 10/11] Moved scriptlet file to an example dir, renamed. | |
--- | |
examples/latin_conjugation.rb | 23 +++++++++++++++++++++++ | |
experiments/latin_experiment.rb | 23 ----------------------- | |
2 files changed, 23 insertions(+), 23 deletions(-) | |
create mode 100755 examples/latin_conjugation.rb | |
delete mode 100755 experiments/latin_experiment.rb | |
diff --git a/examples/latin_conjugation.rb b/examples/latin_conjugation.rb | |
new file mode 100755 | |
index 0000000..ef1a588 | |
--- /dev/null | |
+++ b/examples/latin_conjugation.rb | |
@@ -0,0 +1,23 @@ | |
+#!/usr/bin/ruby | |
+ | |
+BEGIN { | |
+ $LOAD_PATH.unshift File::dirname(File::dirname( __FILE__ )) + "/lib" | |
+ require 'linguistics' | |
+} | |
+ | |
+Linguistics::use( :la ) | |
+ | |
+def divider | |
+ 79.times{print "#"} | |
+ print "\n" | |
+end | |
+ | |
+aFirstConjugationVerbLatinVerb = "amō amāre amāvī amatum".la.conjugate | |
+ | |
+aFirstConjugationVerbLatinVerb.display_full_listing #=> Prints pretty chart to the screen | |
+divider | |
+puts aFirstConjugationVerbLatinVerb.active_voice_indicative_mood_perfect_tense_first_person_plural_number | |
+divider | |
+# Empty the collections cache | |
+aFirstConjugationVerbLatinVerb.collections.shift | |
+puts aFirstConjugationVerbLatinVerb.active_voice_indicative_mood_imperfect_tense | |
diff --git a/experiments/latin_experiment.rb b/experiments/latin_experiment.rb | |
deleted file mode 100755 | |
index ef1a588..0000000 | |
--- a/experiments/latin_experiment.rb | |
+++ /dev/null | |
@@ -1,23 +0,0 @@ | |
-#!/usr/bin/ruby | |
- | |
-BEGIN { | |
- $LOAD_PATH.unshift File::dirname(File::dirname( __FILE__ )) + "/lib" | |
- require 'linguistics' | |
-} | |
- | |
-Linguistics::use( :la ) | |
- | |
-def divider | |
- 79.times{print "#"} | |
- print "\n" | |
-end | |
- | |
-aFirstConjugationVerbLatinVerb = "amō amāre amāvī amatum".la.conjugate | |
- | |
-aFirstConjugationVerbLatinVerb.display_full_listing #=> Prints pretty chart to the screen | |
-divider | |
-puts aFirstConjugationVerbLatinVerb.active_voice_indicative_mood_perfect_tense_first_person_plural_number | |
-divider | |
-# Empty the collections cache | |
-aFirstConjugationVerbLatinVerb.collections.shift | |
-puts aFirstConjugationVerbLatinVerb.active_voice_indicative_mood_imperfect_tense | |
-- | |
1.6.3.1 | |
From 48cf2ce398ef5a809f0e36b4b3c7cfb9cf98d589 Mon Sep 17 00:00:00 2001 | |
From: Steven G. Harms <[email protected]> | |
Date: Tue, 30 Jun 2009 17:25:08 -0500 | |
Subject: [PATCH 11/11] Added README for Latin | |
--- | |
README.latin | 30 ++++++++++++++++++++++++++++++ | |
1 files changed, 30 insertions(+), 0 deletions(-) | |
create mode 100644 README.latin | |
diff --git a/README.latin b/README.latin | |
new file mode 100644 | |
index 0000000..e2e95f5 | |
--- /dev/null | |
+++ b/README.latin | |
@@ -0,0 +1,30 @@ | |
+ | |
+= Latin Ruby Linguistics Module - Synopsis | |
+ | |
+This is an overview of the functionality currently in the Latin functions of | |
+the Ruby Linguistics module as of version 0.02: | |
+ | |
+== Conjugation | |
+ | |
+ Linguistics::use( :la ) | |
+ aFirst = "amō amāre amāvī amatum".la.conjugate | |
+ aFirst.display_full_listing #=> Prints pretty chart to the screen | |
+ aFirst.active_voice_indicative_mood_perfect_tense_first_person_plural_number #=>amāvimus | |
+ aFirstConjugationVerbLatinVerb.active_voice_indicative_mood_imperfect_tense | |
+ #=> Active voice indicative mood imperfect tense: amābam, amābās, amābat, amābāmus, amābātis, amābant | |
+ | |
+== Example | |
+ | |
+See examples/latin_conjugation.rb | |
+ | |
+== TO DO | |
+ | |
+Figure out declensions? | |
+ | |
+== Historical | |
+ | |
+This interface leverages the code I wrote for LatinIRB (http://blackbeardev.com/verbalatinareleases/releases/LatVerb-0.9) | |
+ | |
+== Author of Latin Component | |
+ | |
+Steven G. Harms (http://stevengharms.com) | |
\ No newline at end of file | |
-- | |
1.6.3.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment