Anonymous user
Conjugate a Latin verb: Difference between revisions
Replaced Wren translation by Go translation.
Thundergnat (talk | contribs) m (Thundergnat moved page Conjugate a Latin Verb to Conjugate a Latin verb: Capitalization policy) |
(Replaced Wren translation by Go translation.) |
||
Line 322:
=={{header|Nim}}==
{{trans|
{{Works with|Nim|1.6.0}}
<lang Nim>import
const
proc conjugate(infinitive: string) =▼
Endings = [["o", "as", "at", "amus", "atis", "ant"],
["eo", "es", "et", "emus", "etis", "ent"],
raise newException(ValueError, "not a first conjugation verb.")▼
["o", "is", "it", "imus", "itis", "unt"],
let stem = infinitive[0..^4]▼
["io", "is", "it", "imus", "itis", "iunt"]]
if stem.len == 0:▼
InfinEndings = ["are", "ēre", "ere", "ire"]
raise newException(ValueError, "stem cannot be empty.")▼
Pronouns = ["I", "you (singular)", "he, she or it", "we", "you (plural)", "they"]
echo "Present indicative tense of '$#':" % infinitive▼
▲proc conjugate(infinitive, english: string) =
let letters = infinitive.toRunes()
let infinEnding = $letters[^3..^1]
let conj = InfinEndings.find(infinEnding)
if conj == -1:
▲ raise newException(ValueError, &"
for i, ending in Endings[conj]:
echo &" {stem}{ending:4} {Pronouns[i]} {english}{EnglishEndings[i]}"
echo()
for (infinitive, english) in {"amare": "love", "vidēre": "see", "ducere": "lead", "audire": "hear"}:
conjugate(infinitive, english)</lang>
{{out}}
<pre>Present indicative tense, active voice, of 'amare' to 'love':
amo I love
amas you (singular) love
amat he, she or it loves
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 '
audio I hear
audis you (singular) hear
audit he, she or it hears
audimus we hear
auditis you (plural) hear
=={{header|Perl}}==
|