Abstract

I created a system for inflecting Latin parts of speech. This system includes nouns of all five declensions, adjectives in all three declensions, and verbs in all four conjugations. It also includes some useful helper functions. I intend to package this system into a handful of related and easy-to-use functions in the Wolfram Function Repository.

Nouns

This function displays a table of all the forms of a given noun. As a side note, in America we are taught Latin with cases in this order, but Britain follows this order: Nominative, Vocative, Accusative, Genitive, Dative, Ablative.
In[]:=
LatinCases[ukq_]:=If[ukq,{"Nominative","Vocative","Accusative","Genitive","Dative","Ablative"},{"Nominative","Genitive","Dative","Accusative","Ablative","Vocative"}]
Display a table form in either UK or American order of cases for an arbitrary noun inflection function:
In[]:=
LatinNounTable[func_,root_,ukq_:False]:=With[{cases=LatinCases[ukq]},TableForm[Table[func[root,case,pluralq],{case,cases},{pluralq,{False,True}}],TableHeadings{cases,{"Singular","Plural"}}]]
Some convenience functions to deal with macrons:
In[]:=
macron=<|"a""ā","e""ē","i""ī","o""ō","u""ū"|>
Out[]=
aā,eē,iī,oō,uū
In[]:=
rmacron=AssociationMap[Reverse,macron]
Out[]=
āa,ēe,īi,ōo,ūu

First Declension

First declension nouns end in "a" and have the fewest exceptions. Most are feminine nouns, but there are a few masculine nouns.
Checking to make sure the noun ends in "a", append the right ending onto the stem depending on the case and number:
In[]:=
LatinFirstDeclension[root_/;StringEndsQ[root,"a"],case_,pluralq_]:=If[pluralq,Switch[case,"Nominative",root<>"e","Genitive",StringDrop[root,-1]<>"ārum","Dative",StringDrop[root,-1]<>"īs","Accusative",StringDrop[root,-1]<>"ās","Ablative",StringDrop[root,-1]<>"īs","Vocative",root<>"e"],Switch[case,"Nominative",root,"Genitive",root<>"e","Dative",root<>"e","Accusative",root<>"m","Ablative",StringDrop[root,-1]<>"ā","Vocative",root]]
The user inputs the most common form of a noun, the nominative singular, and specifies which form they want:
In[]:=
LatinNounTable[LatinFirstDeclension,"femina"]
Out[]//TableForm=
Singular
Plural
Nominative
femina
feminae
Genitive
feminae
feminārum
Dative
feminae
feminīs
Accusative
feminam
feminās
Ablative
feminā
feminīs
Vocative
femina
feminae

Second Declension

Second declension nouns are masculine and neuter. These are more challenging because of the number of exceptions.
First, checking if the noun is one of the exceptions specified or ending in "us", then creating the stem and adding the endings:
In[]:=
LatinSecondDeclension[root_,case_,pluralq_]:=​​With[{newroot=StringDrop[root,If[StringEndsQ[root,"us"],-2,If[StringEndsQ[root,{"ager","aper","arbiter","auster","cancer","caper","coluber","conger","culter","faber","fiber","liber","magister,"minister","oleaster","onager","scomber"}],{-2},0]]]},If[pluralq,Switch[case,"Nominative",newroot<>"ī","Genitive",newroot<>"ōrum","Dative",newroot<>"īs","Accusative",newroot<>"ōs","Ablative",newroot<>"īs","Vocative",newroot<>"ī"],Switch[case,"Nominative",root,"Genitive",newroot<>"ī","Dative",newroot<>"ō","Accusative",newroot<>"um","Ablative",newroot<>"ō","Vocative",newroot<>"e"]]]
In[]:=
LatinSecondDeclension[root_/;StringEndsQ[root,"um"],case_,pluralq_]:=With[{drop=StringDrop[root,-2]},If[pluralq,Switch[case,"Nominative",drop<>"a","Genitive",drop<>"ōrum","Dative",drop<>"īs","Accusative",drop<>"a","Ablative",drop<>"īs","Vocative",drop<>"a"],Switch[case,"Nominative",root,"Genitive",drop<>"ī","Dative",drop<>"ō","Accusative",root,"Ablative",drop<>"ō","Vocative",root]]]
Here's an example:
In[]:=
LatinNounTable[LatinSecondDeclension,"deus"]
Out[]//TableForm=
Singular
Plural
Nominative
deus
deī
Genitive
deī
deōrum
Dative
deō
deīs
Accusative
deum
deōs
Ablative
deō
deīs
Vocative
dee
deī

Third Declension

As stated on The National Archives (UK), third declension nouns cannot be uniquely identified from the nominative because they have various forms and spellings, have endings that do not reveal their gender, and can be masculine, feminine, or neuter.
​
In addition, this declension has many exceptions. For those reasons, the code is not shown here.
Here's an example:
In[]:=
LatinNounTable[LatinThirdDeclension,"dux"]
Out[]//TableForm=
Singular
Plural
Nominative
dux
ducēs
Genitive
ducis
ducum
Dative
ducī
ducibus
Accusative
ducem
ducēs
Ablative
duce
ducibus
Vocative
dux
ducēs

Fourth Declension

The fourth declension includes some nouns that are not declined in specific forms, but fortunately, the pattern-matching built in to the Wolfram Language makes each exception a one-liner.
Some example exceptions:
In[]:=
NounFourthMasculineEndings[root_,stem_,"Dative",True]:=stem<>"ubus"​​NounFourthMasculineEndings[root_,stem_,"Ablative",True]:=stem<>"ubus"​​NounFourthMasculineEndings[root_,stem_,case_,pluralq_]:=NounFourthMasculineEndings[root,stem,case,pluralq]
The table for the fourth declension noun genū (knee):
In[]:=
LatinNounTable[LatinFourthDeclension,"genū"]
Out[]//TableForm=
Singular
Plural
Nominative
genū
genua
Genitive
genūs
genuum
Dative
genū
genibus
Accusative
genū
genua
Ablative
genū
genibus
Vocative
genū
genū

Fifth Declension

The fifth declension nouns are generally feminine and also include some nouns without plural forms. In the Genitive and Dative singular, the most common ending is -ī, however it is sometimes declined with the -ē ending shown in parentheses.
The word declined below is an exception as it is not feminine:
In[]:=
LatinNounTable[LatinFifthDeclension,"merīdiēs"]
Out[]//TableForm=
Singular
Plural
Nominative
merīdiēs
merīdiēs
Genitive
merīdiēī (-ē)
merīdiērum
Dative
merīdiēī (-ē)
merīdiēbus
Accusative
merīdiem
merīdiēs
Ablative
merīdiē
merīdiēbus
Vocative
merīdiēs
merīdiēs

Adjectives

This function differs from the noun table because adjectives are most commonly declined in all three genders.
In[]:=
LatinAdjTable[func_,root_,ukq_]:=With[{cases=LatinCases[ukq]},TableForm[Table[StringRiffle[Table[func[root,case,gender,pluralq],{gender,{"Masculine","Feminine","Neuter"}}]," / "],{case,cases},{pluralq,{False,True}}],TableHeadings{cases,{"Singular","Plural"}}]]

First and Second Declension

There are a lot of intricate rules and exceptions here that require many interconnected sub-functions.
LatinAdjTable[LatinFirstSecondAdjectives,"miserum"]
​​
Singular
Plural
Nominative
miserus / misera / miserum
miserī / miserae / misera
Genitive
miserī / miserae / miserī
miserōrum / miserārum / miserōrum
Dative
miserō / miserae / miserō
miserīs / miserīs / miserīs
Accusative
miserum / miseram / miserum
miserōs / miserās / misera
Ablative
miserō / miserā / miserō
miserīs / miserīs / miserīs
Vocative
misere / misera / miserum
miserī / miserae / misera

Third Declension

This declension of adjectives has a great deal of exceptions, similar to the third declension of nouns.
In[]:=
LatinAdjTable[LatinThirdAdjectives,"dives"]
Out[]//TableForm=
Singular
Plural
Nominative
dives / dives / dives
diveēs / diveēs / diveia
Genitive
diveis / diveis / diveis
diveium / diveium / diveium
Dative
diveī / diveī / diveī
diveibus / diveibus / diveibus
Accusative
diveem / diveem / dives
diveīs (-ēs) / diveīs (-ēs) / diveia
Ablative
diveī / diveī / diveī
diveibus / diveibus / diveibus
Vocative
dives / dives / dives
diveēs / diveēs / diveia

Comparative Adjectives

Comparative adjectives are relatively straight-forward as there is only one exception (plūs) to the general rules of declining them.
Plūs is not declined in masculine or feminine singular, hence an error message is printed.
In[]:=
LatinAdjTable[LatinComparativeAdj,"plūs"]
LatinComparativeAdj
::nosg
:-- Message text not found -- (​plūs​)
​
LatinComparativeAdj
::nosg
:-- Message text not found -- (​plūs​)
​
LatinComparativeAdj
::nosg
:-- Message text not found -- (​plūs​)
​
General
:Further output of LatinComparativeAdj::nosg will be suppressed during this calculation.
Out[]//TableForm=
Singular
Plural
Nominative
Null / Null / plūs
plūrēs / plūrēs / plūrēs
Genitive
Null / Null / plūris
plūrium / plūrium / plūrium
Dative
Null / Null / Null
plūribus / plūribus / plūribus
Accusative
Null / Null / plūs
plūrīs (-ēs) / plūrīs (-ēs) / plūrīs (-ēs)
Ablative
Null / Null / plūre
plūribus / plūribus / plūribus
Vocative
Null / Null / plūs
plūrēs / plūrēs / plūrēs

Verbs

Verbs have a greater amount of endings, including most combinations of mood and tense. The four moods are Indicative, Imperative, Infinitive, and Subjunctive.

First Conjugation

This function takes the root (first person singular form), the person, plural/singular, mood, tense, and voice. The stem is calculated from the root.
In[]:=
LatinFirstConjugation[root_,person_,pluralq_,mood_,tense_,activeq_]:=VerbFirstEndings[root,StringDrop[root,If[StringLength[root]>=4,-2,-1]],person,pluralq,mood,tense]
Here's the code for conjugating the Future Infinitive in the passive voice:
In[]:=
VerbFirstEndings[root_,stem_,person_,pluralq_,"Infinitive","Future",False]:=​​stem<>"ātum iri"
Here's an example of amō conjugated in the Future Perfect Indicative in the passive voice:
In[]:=
LatinFirstConjugation["amō","Second",False,"Indicative","FuturePerfect",False]
Out[]=
amātus eris

Second Conjugation

Here's an example of monēo being conjugated in the third person plural form of the Imperfect Subjunctive in passive voice.
In[]:=
LatinSecondConjugation["monēo","Third",True,"Subjunctive","Imperfect",False]
Out[]=
monērentur

Third Conjugation

Here's an example of tegō conjugated in the first person singular form of the Present Subjunctive in active voice.
In[]:=
LatinThirdConjugation["tegō","First",False,"Subjunctive","Present",True]
Out[]=
tegam

Third "io" Conjugation

These third conjugation adjectives have i-stem endings sometimes.
Here's an example of capīo in the first person singular form of the Imperfect Indicative in active voice.
In[]:=
LatinThirdIoConjugation["capīo","First",False,"Indicative","Imperfect",True]
Out[]=
capīēbam

Fourth Conjugation

Here's an example of audiō conjugated in the third person plural of the Future Indicative form in the active voice.
In[]:=
LatinFourthConjugation["audiō","Third",True,"Indicative","Future",True]
Out[]=
audient

Keywords

◼
  • Latin
  • ◼
  • Inflections
  • ◼
  • Declensions
  • ◼
  • Conjugations
  • Acknowledgements

    Thank you to my mentor, Arben Kalziqi. Thank you, Stephen Wolfram, for the project idea and for your guidance.