All is offline except the initial auto-decliner readout.
The xml file accepts only first person singular active indicative verbs and first person singular masculine nouns, adjectives, and adverbs. If you type in something else then you will have a printout of your options. You must manually run the program again to enter them. The program is a one-off and shuts down after its task.
You may still use this program without the internet. You just won't be able to see the declined word and it's form, but the definition will be as normal.
You will need to grab the xml file from Perseus' website for this to work.
Save as 'latin':
Upon executing such in terminal:
You will see:
This program is quite fast at looking up and displaying results when offline—nigh instantaneous—as my tests showed:
With with internet conjugation (searched for and displayed results for 'sum'):
Ran: 100x
Time: 0m28.82s real 0m03.83s user 0m00.55s system
or .31 seconds per search.
Without internet conjugation (searched for and displayed results for 'sum'):
Ran: 1000x
Time: 0m30.96s real 0m27.39s user 0m03.59s system
or .031 seconds per search.
Also, this program is that it displays the results in a more readable format, at least in my opinion. Here is the same entry printed on the Perseus Website:
Upon executing a word with multiple definitions:
You will see:
You must enter 'cum' as 'cum1' or 'cum2' if you want that word defined.
I must warn that there are very likely to be bugs still in the program. Please let me know if you find any.
Enjoy!
*** EDIT ***
NOTE: My computer needed the xml file to be changed from DOS format to a linux-readable format. Open the xml file in nano and save accordingly. The program will not work as intended if this is not done.
The xml file accepts only first person singular active indicative verbs and first person singular masculine nouns, adjectives, and adverbs. If you type in something else then you will have a printout of your options. You must manually run the program again to enter them. The program is a one-off and shuts down after its task.
You may still use this program without the internet. You just won't be able to see the declined word and it's form, but the definition will be as normal.
You will need to grab the xml file from Perseus' website for this to work.
Save as 'latin':
Code:
#!/bin/sh
# The input xml file MUST be changed into a linux-readable format for this program to run
#
# Grab the xml file here: http://www.perseus.tufts.edu/hopper/dltext?doc=Perseus:text:1999.04.0060
#
# Save to your computer.
#
# Name this file as 'latin' and run:
#
# $ chmod +x latin
# $ ./latin amo
#
# Where 'amo' is the term searched.
## Code which connects to perseus to attain 1st per. sg. (needed as key for xml file)
URL="http://www.perseus.tufts.edu/hopper/morph?l=$1&la=la"
XMLfile="Perseus_text_1999.04.0060.xml"
wFIN='<h4 class="la">'
wFOUT='</h4>'
wDefIn='<span class="lemma_definition">'
wDefOut='</span>'
wFormIn='<td class="la">'$1'</td>'
wFormOut='<td style="font-size: x-small">'
wget -q -O- "$URL" | mawk -v vDefIn="$wDefIn" -v vDefOut="$wDefOut" -v vFormIn="$wFormIn" -v vFormOut="$wFormOut" -v vWFIN="$wFIN" -v vWFOUT="$wFOUT" \
'$0 ~ vWFIN,$0 ~ vWFOUT {printf "\n[ " substr($0,18, length($0)-22)" ]"} $0 ~ vDefIn,$0 ~ vDefOut {{ if (!/>/) {{$1=$1}1; print " "$0"";} }} $0 ~ vFormIn,$0 ~ vFormOut {{ if (!/td /) {{$1=$1}1; $0=substr($0,5, length($0)-9); print "-"$0; } } }'
echo
keyIn='key="'$1'"' # Which tag shall be searched?
keyOut='</entry>' #
tagIn='<' # How are tags to be distinguished?
tagOut='>' #
keySepA='' # Separates the main word from its roots
keySepB=',' #
etySepA='[' # Etymology left
etySepB=']\n\n • ' # Etymology right
defSep='\n\n\n' # Separates individual definitions
emSep='\n\n • ' # Separates em-dashes
# First concatenate the result into a usable string
mawk -v vkeyIn="$keyIn" -v vkeyOut="$keyOut" ' $0 ~ vkeyIn, $0 ~ vkeyOut {printf $0}' $XMLfile |
awk -v tagIn="$tagIn" -v tagOut="$tagOut" -v vkeySepA="$keySepA" -v vkeySepB="$keySepB" -v vdefSep="$defSep" -v vetySepA="$etySepA" -v vetySepB="$etySepB" -v vemSep="$emSep" '
# Separation after main key word
{gsub ("<orth>", vkeySepA)}
{gsub ("</orth>", vkeySepB)}
# Add separation for several variations of definitions
{gsub (/<etym lang="la" opt="n">/, vetySepA)}
{gsub (/<\/etym>\. —<\/sense>/, "]")}
{gsub (/<\/etym>, <trans opt="n">/, vetySepB)}
{gsub (/<\/etym>\.—/, vetySepB)}
{gsub (/<\/etym>\. /, "]")}
#{gsub (/<\/etym>/, vetySepB)}
# Get rid of potential extra definition markers
{gsub (/\.—<\/sense>/, ".")}
{gsub (/\.— <\/sense>/, ".")}
{gsub (/\. — <\/sense>/, ".")}
{gsub (/<\/usg>—<\/sense>/, ".")}
# Find and prepare subsections
{gsub (/<sense id=.*level="[0-9]" n="0" opt="n">/, "")}
{gsub (/<sense id=.*"I" opt="n">/, vdefSep)}
{gsub (/<sense id=.*"II" opt="n">/, vdefSep)}
{gsub (/<sense id=.*"III" opt="n">/, vdefSep)}
{gsub (/<sense id=.*"IV." opt="n">/, vdefSep)}
{gsub (/<sense id=.*"IV" opt="n">/, vdefSep)}
{gsub (/<sense id=.*"V." opt="n">/, vdefSep)}
{gsub (/<sense id=.*"VI." opt="n">/, vdefSep)}
{gsub (/<sense id=.*"VII." opt="n">/, vdefSep)}
{gsub (/<sense id=.*"VIII." opt="n">/, vdefSep)}
{gsub (/<sense id=.*"IV." opt="n">/, vdefSep)}
{gsub (/<sense id=.*"X." opt="n">/, vdefSep)}
# Add missing dot after gender
{gsub (/<\/gen>/, ". ")}
# Collapse all remaining tags
{gsub (tagIn "[^" tagOut "]*" tagOut, "")}
# Separate em-dash text
{if ((!/—\\,/) && (!/[a-zA-Z]—/) && (!/ —/)) {gsub (/—/, vemSep)}}
{if ((!/—\\,/) ) {gsub (/\.—/, "." vemSep)}}
{gsub (/ — /, vemSep)}
{if (!/—\\,/) {gsub (/\.—/, "." vemSep)}}
#{gsub (/\.—/, "." vemSep)}
# Remove double spaces and spaces between certain characters
{gsub(/ +/, " ")}
{gsub(/ ,/, ",")}
{gsub(/ \./, ".")}
{gsub(/ \:/, ":")}
{gsub(/ \?/, "?")}
{gsub(/\‘ /, "‘")}
{gsub(/ \’/, "’")}
{gsub(/^ /, "")}
{gsub(/\.\.\. /, "...")}
{printf $0}'
echo
Code:
$ ./latin ad
Code:
[ ad ] to, toward
-prep indeclform
ad, praep. with acc. [cf. Eng. at]
• Of approach (opp. to ab, as in to ex).
I. In space, to, toward: retorquet oculos ad urbem: una pars vergit ad septentriones, Cs.: tendens ad sidera palmas, V. —Fig.: ad alia vitia propensior, more inclined to. —Esp., ad dextram, sinistram, or laevam, to or on the right or left: ito ad dextram, T.: alqd ad dextram conspicere, Cs.: non rectā regione...sed ad laevam, L.
• Designating the goal, to, toward: ad ripam convenire, Cs.: vocari ad cenam, H.: ad se adferre: reticulum ad narīs sibi admovebat (cf. accedit ad urbem, he approaches the city; and, accedit provinciae, it is added to the province).
• Ad me, te, se, for domum meam, tuam, suam (in T. freq.): eamus ad me, T.
• With gen., ellipt.: ad Dianae, to the temple of, T.: ad Castoris currere.
• Used for dat: litteras dare ad aliquem, to write one a letter (cf. litteras dare alicui, to give a letter to one): domum ad te scribere: ad primam (epistulam) scribere, to answer.
• Hence, librum ad aliquem mittere, scribere, to dedicate a book to one. —In titles, ad aliquem signifies to, addressed to.
• With names of towns, ad answers to Whither? for the simple acc., i. e. to the vicinity of, to the neighborhood of: ad Aquinum accedere, approach: ut cum suis copiis iret ad Mutinam.
• Of hostile movement or protection, against (cf. adversus): veniri ad se existimantes, Cs.: ipse ad hostem vehitur, N.: Romulus ad regem impetum facit (cf. in), L.: clipeos ad tela protecti obiciunt, V.: ad hos casūs provisa praesidia, Cs.
• In war, of manner of fighting: ad pedes pugna venerat, was fought out on foot, L.: equitem ad pedes deducere, L.: pugna ad gladios venerat, L.
• Emphatic of distance, to, even to, all the way to: a Salonis ad Oricum portūs...occupavit, Cs.: usque a Dianis ad Sinopum navigare.
• Fig.: deverberasse usque ad necem, T.: virgis ad necem caedi.
• Of nearness or proximity in gen. (cf. apud), near to, by, at, close by: ad forīs adsistere: Ianum ad infimum Argiletum fecit, L.: quod Romanis ad manum domi supplementum esset, at hand, L.: errantem ad flumina, V.; and ellipt.: pecunia utinam ad Opis maneret!
• Of persons: qui primum pilum ad Caesarem duxerat, Cs.: ad me fuit, at my house: ad inferos poenas parricidi luent, among.
• So, fig.: ad omnīs nationes sanctum, in the judgment of, Cs.: ut esset ad posteros monumentum, etc., L.: ad urbem esse (of a general outside of the walls): ad urbem cum imperio remanere, Cs.
• With names of towns and verbs of rest: pons, qui erat ad Genavam, Cs.; and with an ordinal number and lapis: sepultus ad quintum lapidem, N..
II. In time, about, toward: domum reductus ad vesperum, toward evening.
• Till, until, to, even to, up to: usque ad hanc aetatem: ad multam noctem: amant ad quoddam tempus, until: quem ad finem? how long: ad quartam (sc. horam), H.
• Hence, ad id (sc. tempus), till then: ad id dubios servare animos, L.
• At, on, in, by: ad horam destinatam, at the appointed hour: frumentum ad diem dare.
III. In number or amount, near, near to, almost, about, toward (cf. circiter): talenta ad quindecim coëgi, T.: annos ad quadraginta natus.
• Adverb.: occisis ad hominum milibus quattuor, Cs.: ad duo milia et trecenti occisi, L.
• Of a limit, to, unto, even to (rare): (viaticum) ad assem perdere, to the last farthing, H.: ad denarium solvere. —Esp., ad unum, to a single one, without exception: omnes ad unum idem sentiunt: exosus ad unum Troianos, V. —
IV. In other relations, with regard to, in respect of, in relation to, as to, to, in: ad honorem antecellere: nihil ad rem pertinet.
• Ellipt.: rectene an secus, nihil ad nos: Quid ad praetorem? quid ad rem? i. e. what difference does it make? H.: quibus (auxiliaribus) ad pugnam confidebat, Cs.: ad speciem ornatus, ad sensum acerbus: mentis ad omnia caecitas: ad cetera paene gemelli, H.: facultas ad dicendum.
• With words denoting measure, weight, manner, model, rule, etc., according to, agreeably to, after: taleis ad certum pondus examinatis, Cs.: ad cursūs lunae describit annum, L.: canere ad tibiam: carmen castigare ad unguem, to perfection (see unguis), H.: ad istorum normam sapientes: ad specus angustiae vallium (i. e. ad specuum similitudinem angustae valles), Cs.
• With the cause or reason, according to, at, on, in consequence of, for, in order to: ad horum proces in Boeotiam duxit, on their entreaty, L.: dictis ad fallendum instructis, L.: causae ad discordiam, to produce dissension, T.: ad facinora incendere, S.: ad speciem tabernaculis relictis, for appearance, Cs.: ad id, for this use, as a means to that end, L.: ad id ipsum, for that my purpose, L.: delecto milite ad navīs, marines, L.: puer ad cyathum statuetur, H.: biiugi ad frena leones, yoked in pairs with bits, V.: res quae sunt ad incendia, Cs.: ad communem salutem utilius.
• In comparison, to, compared with, in comparison with: terra ad universi caeli complexum: nihil ad tuum equitatum, Caesar.
V. In adverbial phrases, ad omnia, withal, to crown all: ad omnia tantum advehi auri, etc., L.
• Ad hoc and ad haec, moreover, besides, in addition: ad hoc, quos...postremo omnes, quos, etc., S.
• Ad id quod, beside that (rare): ad id quod...indignitate etiam Romani accendebantur, L.
• Ad tempus, at a definite, fixed time, C., L.; at a fit, appropriate time, L.; for some time, for a short time, L.; according to circumstances.
• Ad praesens, for the moment, for a short time.
• Ad locum, on the spot: ut ad locum miles esset paratus, L.
• Ad verbum, word for word, literally.
• Ad summam, on the whole, generally, in general; in a word, in short, C., H.
• Ad extremum, ad ultimum, ad postremum, at the end, finally, at last; of place, at the extremity, at the top, at the end: ad extremum (teli) unde ferrum exstabat, L.; of time, at last, finally: ad extremum incipit philosophari; of order, finally, lastly; to the last degree, quite, L.
• Quem ad finem? to what limit? how far? how long? Note.
• a. Ad rarely follows its acc: quam ad, T.: quos ad, C.: ripam ad Araxis, Ta.
• b. In composition, ad- stands before vowels, b, d, f, h, i consonant, m, n, q, v, and mostly before l, r, s; acbefore c; but very often ad- before cl-, cr-, and cu-; ag- or ad- before g; ap- or ad- before p; atbefore t; but a- or ad- before gn, sp, sc, st.
$
With with internet conjugation (searched for and displayed results for 'sum'):
Ran: 100x
Time: 0m28.82s real 0m03.83s user 0m00.55s system
or .31 seconds per search.
Without internet conjugation (searched for and displayed results for 'sum'):
Ran: 1000x
Time: 0m30.96s real 0m27.39s user 0m03.59s system
or .031 seconds per search.
Also, this program is that it displays the results in a more readable format, at least in my opinion. Here is the same entry printed on the Perseus Website:
Code:
ad praep. with acc.
cf. Eng. at.—Of approach (opp. to ab, as in to ex).
I.I. In space, to, toward: retorquet oculos ad urbem: una pars vergit ad septentriones, Cs.: tendens ad sidera palmas, V. —Fig.: ad alia vitia propensior, more inclined to. —Esp., ad dextram, sinistram, or laevam, to or on the right or left: ito ad dextram, T.: alqd ad dextram conspicere, Cs.: non rectā regione ... sed ad laevam, L.—Designating the goal, to, toward: ad ripam convenire, Cs.: vocari ad cenam, H.: ad se adferre: reticulum ad narīs sibi admovebat (cf. accedit ad urbem, he approaches the city; and, accedit provinciae, it is added to the province).— Ad me, te, se, for domum meam, tuam, suam (in T. freq.): eamus ad me, T. — With gen., ellipt.: ad Dianae, to the temple of, T.: ad Castoris currere. — Used for dat: litteras dare ad aliquem, to write one a letter (cf. litteras dare alicui, to give a letter to one): domum ad te scribere: ad primam (epistulam) scribere, to answer.—Hence, librum ad aliquem mittere, scribere, to dedicate a book to one. —In titles, ad aliquem signifies to, addressed to.— With names of towns, ad answers to Whither? for the simple acc., i. e. to the vicinity of, to the neighborhood of: ad Aquinum accedere, approach: ut cum suis copiis iret ad Mutinam. — Of hostile movement or protection, against (cf. adversus): veniri ad se existimantes, Cs.: ipse ad hostem vehitur, N.: Romulus ad regem impetum facit (cf. in), L.: clipeos ad tela protecti obiciunt, V.: ad hos casūs provisa praesidia, Cs.—In war, of manner of fighting: ad pedes pugna venerat, was fought out on foot, L.: equitem ad pedes deducere, L.: pugna ad gladios venerat, L. — Emphatic of distance, to, even to, all the way to: a Salonis ad Oricum portūs ... occupavit, Cs.: usque a Dianis ad Sinopum navigare. — Fig.: deverberasse usque ad necem, T.: virgis ad necem caedi.—Of nearness or proximity in gen. (cf. apud), near to, by, at, close by: ad forīs adsistere: Ianum ad infimum Argiletum fecit, L.: quod Romanis ad manum domi supplementum esset, at hand, L.: errantem ad flumina, V.; and ellipt.: pecunia utinam ad Opis maneret! — Of persons: qui primum pilum ad Caesarem duxerat, Cs.: ad me fuit, at my house: ad inferos poenas parricidi luent, among.—So, fig.: ad omnīs nationes sanctum, in the judgment of, Cs.: ut esset ad posteros monumentum, etc., L.: ad urbem esse (of a general outside of the walls): ad urbem cum imperio remanere, Cs.—With names of towns and verbs of rest: pons, qui erat ad Genavam, Cs.; and with an ordinal number and lapis: sepultus ad quintum lapidem, N.—
II.II. In time, about, toward: domum reductus ad vesperum, toward evening.—Till, until, to, even to, up to: usque ad hanc aetatem: ad multam noctem: amant ad quoddam tempus, until: quem ad finem? how long: ad quartam (sc. horam), H. — Hence, ad id (sc. tempus), till then: ad id dubios servare animos, L.— At, on, in, by: ad horam destinatam, at the appointed hour: frumentum ad diem dare. —
III.III. In number or amount, near, near to, almost, about, toward (cf. circiter): talenta ad quindecim coëgi, T.: annos ad quadraginta natus.—Adverb.: occisis ad hominum milibus quattuor, Cs.: ad duo milia et trecenti occisi, L.—Of a limit, to, unto, even to (rare): (viaticum) ad assem perdere, to the last farthing, H.: ad denarium solvere. —Esp., ad unum, to a single one, without exception: omnes ad unum idem sentiunt: exosus ad unum Troianos, V. —
IV..IV. In other relations, with regard to, in respect of, in relation to, as to, to, in: ad honorem antecellere: nihil ad rem pertinet.—Ellipt.: rectene an secus, nihil ad nos: Quid ad praetorem? quid ad rem? i. e. what difference does it make? H.: quibus (auxiliaribus) ad pugnam confidebat, Cs.: ad speciem ornatus, ad sensum acerbus: mentis ad omnia caecitas: ad cetera paene gemelli, H.: facultas ad dicendum.—With words denoting measure, weight, manner, model, rule, etc., according to, agreeably to, after: taleis ad certum pondus examinatis, Cs.: ad cursūs lunae describit annum, L.: canere ad tibiam: carmen castigare ad unguem, to perfection (see unguis), H.: ad istorum normam sapientes: ad specus angustiae vallium (i. e. ad specuum similitudinem angustae valles), Cs. — With the cause or reason, according to, at, on, in consequence of, for, in order to: ad horum proces in Boeotiam duxit, on their entreaty, L.: dictis ad fallendum instructis, L.: causae ad discordiam, to produce dissension, T.: ad facinora incendere, S.: ad speciem tabernaculis relictis, for appearance, Cs.: ad id, for this use, as a means to that end, L.: ad id ipsum, for that my purpose, L.: delecto milite ad navīs, marines, L.: puer ad cyathum statuetur, H.: biiugi ad frena leones, yoked in pairs with bits, V.: res quae sunt ad incendia, Cs.: ad communem salutem utilius.—In comparison, to, compared with, in comparison with: terra ad universi caeli complexum: nihil ad tuum equitatum, Caesar.—
V..V. In adverbial phrases, ad omnia, withal, to crown all: ad omnia tantum advehi auri, etc., L.—Ad hoc and ad haec, moreover, besides, in addition: ad hoc, quos ... postremo omnes, quos, etc., S. — Ad id quod, beside that (rare): ad id quod ... indignitate etiam Romani accendebantur, L. — Ad tempus, at a definite, fixed time, C., L.; at a fit, appropriate time, L.; for some time, for a short time, L.; according to circumstances. — Ad praesens, for the moment, for a short time.—Ad locum, on the spot: ut ad locum miles esset paratus, L.—Ad verbum, word for word, literally. — Ad summam, on the whole, generally, in general; in a word, in short, C., H.—Ad extremum, ad ultimum, ad postremum, at the end, finally, at last; of place, at the extremity, at the top, at the end: ad extremum (teli) unde ferrum exstabat, L.; of time, at last, finally: ad extremum incipit philosophari; of order, finally, lastly; to the last degree, quite, L. — Quem ad finem? to what limit? how far? how long? Note .—a. Ad rarely follows its acc: quam ad, T.: quos ad, C.: ripam ad Araxis, Ta.—b. In composition, ad- stands before vowels, b, d, f, h, i consonant, m, n, q, v, and mostly before l, r, s; acbefore c; but very often ad- before cl-, cr-, and cu-; ag- or ad- before g; ap- or ad- before p; atbefore t; but a- or ad- before gn, sp, sc, st.
Code:
$ ./latin cum
Code:
[ Cos2 ] Apelles
-noun sg fem acc
-noun pl fem gen poetic
[ Cum2 ] when, at the time when
-prep indeclform
-conj indeclform
[ cos ] a flint-stone, whetstone, grindstone
-noun sg fem acc
-noun pl fem gen poetic
[ cum ] with, together with, in the company of, in connection with, along with, together, and
-prep indeclform
-conj indeclform
$
I must warn that there are very likely to be bugs still in the program. Please let me know if you find any.
Enjoy!
*** EDIT ***
NOTE: My computer needed the xml file to be changed from DOS format to a linux-readable format. Open the xml file in nano and save accordingly. The program will not work as intended if this is not done.