Jump to content

Conjugate a Latin verb: Difference between revisions

→‎{{header|Wren}}: Added English meanings to extended version.
(→‎{{header|ALGOL 68}}: Changed to revised task reuirements)
(→‎{{header|Wren}}: Added English meanings to extended version.)
Line 479:
</pre>
<br>
{{libheader|Wren-fmt}}
The following extended version can deal with regular verbs of all four conjugations. To distinguish 2nd and 3rd conjugations, ana over-bar is placed above the penultimate 'e' in a second conjugation infinitive but accents are otherwise ignored. English meanings have also been added.
<lang ecmascript>varimport endings"/fmt" =for [Fmt
 
var endings = [
[ "o", "as", "at", "amus", "atis", "ant"],
["eo", "es", "et", "emus", "etis", "ent"],
Line 489 ⟶ 492:
var infinEndings = ["are", "ēre", "ere", "ire"]
 
var pronouns = ["I", "you (singular)", "he, she or it", "we", "you (plural)", "they"]
var conjugate = Fn.new { |infinitive|
 
var englishEndings = [ "", "", "s", "", "", "" ]
 
var conjugate = Fn.new { |infinitive, english|
var letters = infinitive.toList
if (letters.count < 4) Fiber.abort("Infinitive is too short for a regular verb.")
Line 496 ⟶ 503:
if (conj == -1) Fiber.abort("Infinitive ending -%(infinEnding) not recognized.")
var stem = letters[0..-4].join()
System.print("Present indicative tense, active voice, of '%(infinitive)' to '%(english)':")
var i = 0
for (ending in endings[conj]) System.print(" " + stem + ending){
Fmt.print(" $s$-4s $s $s$s", stem, ending, pronouns[i], english, englishEndings[i])
i = i + 1
}
System.print()
}
 
forvar (infinitivepairs in= [["amare", "love"], ["vidēre", "see"], ["ducere", "audirelead"]), conjugate.call(infinitive)</lang>["audire", "hear"]]
for (pair in pairs) conjugate.call(pair[0], pair[1])</lang>
 
{{out}}
<pre>
Present indicative tense, active voice, of 'amare' to 'love':
amo I love
amas you (singular) love
amas
amat he, she or it loves
amat
amamus we love
amatis you (plural) love
amant they love
 
Present indicative tense, active voice, of 'vidēre' to 'see':
video I see
vides you (singular) see
videt he, she or it sees
videmus we see
videtis you (plural) see
vident they see
 
Present indicative tense, active voice, of 'ducere' to 'lead':
duco I lead
ducis you (singular) lead
ducit he, she or it leads
ducimus we lead
ducitis you (plural) lead
ducunt they lead
 
Present indicative tense, active voice, of 'audire' to 'hear':
audio I hear
audis you (singular) hear
audit he, she or it hears
audimus we hear
auditis you (plural) hear
audiunt they hear
</pre>
9,486

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.