Linux Script for offline Lewis & Short Elementary Dictionary

By bathtime, in 'Latin Language Resources', Feb 24, 2018.

  1. bathtime Member

    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':
    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
    Upon executing such in terminal:
    Code:
    $ ./latin ad
    You will see:
    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.
     
    $ 
    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:
    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.
    Upon executing a word with multiple definitions:
    Code:
    $ ./latin cum
    You will see:
    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
     
     
    $ 
    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.
    Last edited by bathtime, Feb 24, 2018
  2. Quasus Civis Illustris

    • Civis Illustris
    Location:
    Coimbra, Portugal
    Great!

    BTW, the DOS file seems to work for me. Anyway, here's a one-liner grabbing the file and fixing the line endings:
    Code:
    wget -qO- 'http://www.perseus.tufts.edu/hopper/dltext?doc=Perseus:text:1999.04.0060' | tr -d '\r' > Perseus_text_1999.04.0060.xml
    I think it's a shortcoming of the script that it can only be called from the directory where the xml file resides. The following patch fixes that:
    Code:
    20c20
    < XMLfile="Perseus_text_1999.04.0060.xml"
    ---
    > XMLfile="$(dirname "$0")/Perseus_text_1999.04.0060.xml"
    Personally, I dump scripts like that to ~/bin, which is in my PATH (just in case someone is interested :)).
    bathtime likes this.
  3. bathtime Member

    Thank you for this!

    I've given the program a much needed update which will fix an issue with missing definitions and layout issues. Now the XML file is automatically downloaded to ~/.config/latin/. And, thanks to you, that DOS file error went away by use of your code! ;) Apparently, by running that trim, it just makes the file Linux format? Anyways, it now works on my machine without intervention.

    latin:
    Code:
    #!/bin/bash
     
    # This program requires an xml dictionary file to run. If it is not on your machine,
    # this program will automatically download it and store in ~/.config/latin/.
     
    # Name this file as 'latin' and run:
    #
    # $ chmod +x latin
    #
    # To run:
    # $ ./latin amo
    #
    # To enable internet auto-decline:
    # $ ./latin -d amo
    #
    # To run with only auto-decline:
    # $ ./latin -c amo
    #
    # Where 'amo' is the term searched.
     
    key=$2
     
    URL="http://www.perseus.tufts.edu/hopper/morph?l=$key&la=la"
     
    wFIN='<h4 class="la">'
    wFOUT='</h4>'
    wDefIn='<span class="lemma_definition">'
    wDefOut='</span>'
    wFormIn='<td class="la">'$key'</td>'
    wFormOut='<td style="font-size: x-small">'
     
    ## Code which connects to perseus to attain 1st per. sg. (needed as key for xml file)
    if [[ ("$1" == "-d") ]]; then
     
    searchTerms=$(wget -q -O- "$URL" | mawk -v vWFIN="$wFIN" -v vWFOUT="$wFOUT" \
    ' $0 ~ vWFIN,$0 ~ vWFOUT {printf substr($0,18, length($0)-22)"\n"; next;}')
     
    elif [[ ("$1" == "-c") ]]; then
     
    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)" ]"; next;}   $0 ~ vDefIn,$0 ~ vDefOut {{ if (!/>/) {{$1=$1}1; x+=1; print " "$0"";} }}   $0 ~ vFormIn,$0 ~ vFormOut {{ if (!/td /) {{$1=$1}1;   $0=substr($0,5, length($0)-9); print "-"$0; next;} } }'
     
    else
    searchTerms=$1
    fi
     
    if [ "$1" == "-c" ]; then
    exit
    fi
     
    XMLfile=Perseus_text_1999.04.0060.xml
    XMLdir=~/.config/latin/
    XMLlink="http://www.perseus.tufts.edu/hopper/dltext?doc=Perseus:text:1999.04.0060"
     
    if [ ! -e $XMLdir$XMLfile ]; then
            echo "\nFile:" $XMLdir$XMLfile "not found.\n\nDownloading from" $XMLlink "...\n"
    mkdir -p ~/.config/latin
    wget -qO- $XMLlink | tr -d '\r' > $XMLdir$XMLfile
    fi
     
    for key in $searchTerms; do
     
    keyIn='key="'$key'"'# Which tag shall be searched?
    keyOut='</entry>'#
    tagIn='<'# How are tags to be distinguished?
    tagOut='>'#
    defTagIn='<sense'# Ad
    defTagOut='>'
    keySepA=''# Separates the main word from its roots
    keySepB=','#
    etySepA='['# Etymology left
    etySepB=']\n\n • '# Etymology right
    defSep='\n\n '          # Separates individual definitions
    emSep='\n\n • '# Separates em-dashes
     
    # First concatenate the result into a usable string
    awk -v vkeyIn="$keyIn" -v vkeyOut="$keyOut" ' $0 ~ vkeyIn, $0 ~ vkeyOut {printf $0; }' $XMLdir$XMLfile |
    awk -v vdefTagIn="$defTagIn" -v vdefTagOut="$defTagOut" -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(/<sense id.*><etym lang="la" opt="n">/, vetySepA)
    gsub(/<\/etym>\. —<\/sense>/, "]")
    gsub(/<\/etym>\, <trans opt="n">/, vetySepB)
    gsub(/<\/etym>\.—/, vetySepB)
    gsub(/<\/etym>\. /, "]")
     
    # Get rid of potential extra definition markers
    gsub(/\.—<\/sense>/, ".")
    gsub(/\.— <\/sense>/, ".")
    gsub(/\. — <\/sense>/, ".")
    gsub(/<\/usg>—<\/sense>/, ".")
    gsub(/<\/usg> —<\/sense>/, ".")
     
    # Add missing dot after gender
    gsub(/<\/gen>/, ". ")
     
    # Collapse all definition tags and add formatting in their place
    gsub(vdefTagIn "[^" vdefTagOut "]*" vdefTagOut, vdefSep)
     
    # Collapse all remaining tags
    gsub(tagIn "[^" tagOut "]*" tagOut, "")
     
    # Separate em-dash text
    if ((!/—\\,/) && (!/[a-zA-Z]—/) && (!/ —/)) gsub (/—/, vemSep)
            if ((!/—\\,/) ) gsub (/\.—/, "." vemSep)
            gsub (/ — /, vemSep)
    gsub (/ —/, vemSep)
    if (!/—\\,/) gsub (/\.—/, "." vemSep)
     
    # Remove double spaces and spaces between certain characters
    gsub(/ +/,  " ")
    gsub(/ ,/,  ",")
    gsub(/\( /, "(")
    gsub(/ \)/, ")")
    gsub(/ \./, ".")
    gsub(/ \:/, ":")
    gsub(/ \?/, "?")
    gsub(/\‘ /, "‘")
    gsub(/ \’/, "’")
    gsub(/^ /,  "" )
    gsub(/\.\.\. /, "...")
     
    }
     
    { print "\n" $0 "\n" } '
     
    done
    Upon running:
    Code:
    $ ./latin -d sui
    If all is well, you will see:
    Code:
    suī, (gen.), dat. sibi or sibī, acc. and abl. sē or (more emphatic) sēsē (strengthened sēpse for sē ipse, C.; sēmet, L., H.), sing. and plur, pron. of 3d pers. [suus]
     
    I. Reflex.
     
    A. Himself, herself, itself, themselves.
     
    • Referring to the grammatical subj —Acc., as direct obj: si is posset ab eā sese avellere, T.: per eos, ne causam diceret, se eripuit, Cs.: homo se erexit: se a Gallis auro redemisse, L.: se gerere, to behave: ipse enim se quisque diligit: se ipsum conligere.
     
    • With gerundive: ne sui in perpetuum liberandi occasio, Cs.: sui conservandi causā profugere: is sibi legationem ad civitates suscepit, Cs.: propositā sibi morte: Medus infestus sibi, H.: tantos sibi spiritūs sumpserat, Cs.: inimicus ipse sibi putandus est.
     
    • Gen obj.: amans sui virtus: dux oblitus sui: potens sui, H.: caecus amor sui, H.: facultatem sui insequendi ademerat, Cs.
     
    • Acc. or abl., with praepp.: ducit secum virginem, T.: pro se quisque sedulo Faciebant, each one singly, T.: cum pro se quisque tenderent ad portas, L.: equitatum ante se mittit, Cs.: litterae ad se ab amico missae: exercitus, quantum in se fuit, etc., L.
     
    • Referring to a logical subject.
     
    • To a definite subject: multis illi in urbibus reficiendi se et curandi potestas fuit: Faustulo spes fuerat regiam stirpem apud se educari, L.: invenere oppidanos vim hostium ab se arcentes, L.
     
    • To an indefinite subject, oneself: deforme est de se ipsum praedicare: ut, quanti quisque se ipse faciat, tanti fiat ab amicis.
     
    B. In dependent clauses, as pers. pron. 3 d pers., with reflex. reference, him, her, it, them, he, she, they.
     
    • In gen., referring to the grammatical subject of the principal clause: impetrat a senatu, ut dies sibi prorogaretur: Ubii legatos mittunt, qui doceant...neque ab se fidem laesam, Cs.: in urbibus, quae ad se defecerant, praesidia imposuit, S.
     
    • Referring to a logical subject: a regibus litterae, quibus mihi gratias agant, quod se reges appellaverim: cum legati ad eum venissent oratum, ut sibi ignosceret, Cs.
     
    • In orat. obliquā, referring to the person whose words are reported: nuntium mittit...sese diutius sustinere non posse, Cs.: non sese Gallis, sed Gallos sibi bellum intulisse, Cs.: dato responso (a Thyrreensibus), nullam se novam societatem accepturos, L.
     
    • In subordinate clauses, with subjunct.: qui abs te taciti requirunt, cur sibi hoc oneris imposueris: conclamavit, quid ad se venirent? Cs.: multa pollicens, si se conservasset, N.
     
    • With subj. (sub-oblique), expressing the view of the reported speaker: Caesarem iniuriam facere, qui vectigalia sibi deteriora faceret, Cs.: quod nec paratus...obsecutus esset, credidissetque, cum se vidissent Aetoli, omnia, etc., L. —Instead of the proper case of is or ipse (to suggest the point of view of the person referred to): Unum hoc scio, esse meritam, ut memor esses sui, T.: quem Caesar, ut erat de se meritus, donatum pronuntiavit, Cs.: statuit urbīs, quae...adversum se opportunissimae erant, circumvenire, S.: centum boves militibus dono dedit, qui secum fuerant, L..
     
    C. Idiomatic uses, with ad or apud, to one's house, at home: qui a me petierit ut secum et apud se essem cottidie: Num tibi videtur esse apud sese? in his senses, T.
     
    • Dat pleonast., of the person interested, for himself: quid sibi hic vestitus quaerit? T.: mirantes, quid sibi vellet, L.
     
    • Colloq., with suus (old): Suo sibi gladio hunc iugulo, his very own, T..
     
    II. As pron recipr., each other, one another: nuntiatum...patres ac plebem in semet ipsos versos, L.; usu. in the phrase, inter se, one another, each other, mutually, reciprocally: video eos inter se amare, T.: neque solum colent inter se ac diligent: ut neque inter se contingant trabes, Cs.: adhaesiones atomorum inter se: collīs duos propinquos inter se occupat, S.
     
     
    suō, suī, sūtus, ere [SV-]
     
    • to sew, stitch, sew up, sew together: tegumenta corporum suta: sutis arcent frigora bracis, O.: corticibus suta cavatis alvearia, V.
     
    • Fig.: ne quid...suo suat capiti, devise, T.
     
     
    sūs, suis, m. and f. [cf. u(/s; Engl. sow, swine]
     
    • a swine, hog, pig, boar, sow: sus quid habet praeter escam?: Saetigerae fetus suis, a young pig, V., L., H., O.
     
    • Prov.: sus Minervam docet (of an ignorant person attempting to instruct one better informed): docebo sus, ut aiunt, oratorem.
     
    • A fish, O.
     
     
    suus, (suae, monosyl., T.; gen plur. suūm, T.), pron poss. 3d pers. [cf. sui, e(/os]
     
    I. In gen.
     
    A. With reflex reference, of oneself, belonging to oneself, his own, her own, his, her, its, their.
     
    • Referring to a subst. expressed or understood, in any gender or case: Caesar copias suas divisit, his, Cs.: in suā sententiā perseverat, Cs.: anteposuit suam salutem meae: suos parentes reperire, T.: omne animal et se ipsum et omnīs partīs suas diligit, its: (legiones) si consulem suum reliquerunt, their: naves cum suis oneribus, with their several cargoes, L.: suae causae confidere: hunc sui cives e civitate eiecerunt, was exiled by his fellow-citizens: ipsum suo nomine diligere, for his own sake: suis flammis delete Fidenas, i. e. the flames kindled by the Fidenates, L.: (Siculis ereptae sunt) suae leges: Scipio suas res Syracusanis restituit, L.: inimicissimus suus: Clodius, suus atque illius familiaris, Cs.: diffidens rebus suis: Caesar, primum suo deinde omnium ex conspectu remotis equis, etc., Cs.: doloris sui de me declarandi potestas.
     
    • Rarely with a subj clause as antecedent: secutum suā sponte est, ut, etc., of course, L.
     
    • Without a grammatical antecedent, one's, one's own: si quidem est atrocius, patriae parentem quam suum occidere: in suā civitate vivere: levius est sua decreta tollere quam aliorum, L.
     
    • Referring to an antecedent determined by the context, and conceived as authority for the statement, or as entertaining the thought, his, her, its, their: (Clodius) Caesaris potentiam suam esse dicebat: hostes viderunt...suorum tormentorum usum spatio propinquitatis interire, Cs.: ne ea quae rei p. causā egerit (Pompeius) in suam (i. e. Caesaris) contumeliam vertat, Cs.: mulieres viros orantes, ne parricidio macularent partūs suos (i. e. mulierum), L..
     
    B. Without reflex reference, his, her, its, their.
     
    • To avoid ambiguity: petunt rationes illius (Catilinae), ut orbetur auxilio res p., ut minuatur contra suum furorem imperatorum copia (for eius, which might be referred to res p.).
     
    • For emphasis, instead of eius, own, peculiar: mira erant in civitatibus ipsorum furta Graecorum quae magistratūs sui fecerant, their own magistrates.
     
    • Rarely for eius without emphasis (poet. or late): Cimon incidit in eandem invidiam quam pater suus, N.: Ipse sub Esquiliis, ubi erat sua regia Concidit, O.
     
    II. Esp.
     
    A. Plur m. as subst., of intimates or partisans, one's people, their own friends: Cupio abducere ut reddam suis, to her family, T.: mulier praecepit suis, omnia Caelio pollicerentur, her slaves: vellem hanc contemptionem pecuniae suis reliquisset, to his posterity: naviculam conscendit cum paucis suis, a few of his followers, Cs.: inprimis inter suos nobilis, his associates: subsidio suorum proelium restituere, comrades, L.: bestias ad opem suis ferendam avertas, their young, L.
     
    • Sing f., a sweetheart, mistress: illam suam suas res sibi habere iussit.
     
    • Sing. and plur n., one's own things, one's property: ad suum pervenire: sui nihil deperdere, Cs.: meum mihi placebat, illi suum, his own work: expendere quid quisque habeat sui, what peculiarities: tibi omnia sua tradere, all he had: se suaque transvehere, their baggage, L.: Aliena melius diiudicare Quam sua, their own business, T..
     
    B. Predicative uses, under one's own control, self-possessed, composed: semper esse in disputando suus: Vix sua, vix sanae compos Mentis, O.
     
    • In gen., under one's control, his property, his own: causam dicere aurum quā re sit suum, T.: qui suam rem nullam habent, nothing of their own: ut (Caesar) magnam partem Italiae suam fecerit, has made subject, Cs.: exercitum senatūs populique R. esse, non suum: ne quis quem civitatis mutandae causā suum faceret, made any one his slave, L.: eduxit mater pro suā, as her own, T.: arbitrantur Suam Thaidem esse, devoted to them, T.: Vota suos habuere deos, had the gods on their side, O..
     
    C. In phrases, suā sponte, of one's own accord, voluntarily, by oneself, spontaneously, without aid, unprompted: bellum suā sponte suscipere: omne honestum suā sponte expetendum, for its own sake ; see (spons).
     
    • Suus locus, one's own ground: restitit suo loco Romana acies, in its own lines, L.: aciem instruxit suis locis, Cs..
     
    D. Praegn., characteristic, peculiar voluptatem suis se finibus tenere iubeamus, within the limits assigned to it.
     
    • Intrinsic, original. (Platoni) duo placet esse motūs, unum suum, alterum externum, etc.
     
    • Private: in suis rebus luxuriosus militibus agros ex suis possessionibus pollicetur, i. e. his private property, Cs.
     
    • Just, due, appropriate: imperatori exercituique honos suus redditus, due to them, L.: is mensibus suis dimisit legionem, i. e. in which each soldier's term ended, L.: suo iure, by his own right: lacrimae sua verba sequuntur, i. e. appropriate (to tears), O.
     
    • Own, peculiar, exclusive, special: mentio inlata est, rem suo proprio magistratu egere, i. e. a special officer, L.: ni suo proprio eum proelio equites exceptum tenuissent, i. e. in which they alone fought, L.: quae est ei (animo) natura? Propria, puto, et sua: equitem suo alienoque Marte pugnare, i. e. both as cavalry and as infantry, L.: Miraturque (arbos) novas frondes et non sua poma (of engrafted fruit), V.
     
    • Own, devoted, friendly, dear: habere suos consules, after his own heart: conlegit ipse se contra suum Clodium, his dear Clodius.
     
    • Own, chosen by himself, favorable, advantageous: suo loco pugnam facere, S.: suis locis bellum in hiemem ducere, Cs.: numquam nostris locis laboravimus, L.: suam occasionem hosti dare, L.: aestuque suo Locros traiecit, a favorable tide, L.: Ventis ire non suis, H.
     
    • Proper, right, regular, normal: si suum numerum naves haberent, their regular complement: numerum non habet illa (ratis) suum, its full number, O.: cum suo iusto equitatu, L.: cessit e vitā suo magis quam suorum civium tempore, the right time for himself: sua tempora exspectare, L.
     
    • Own, independent: ut suae leges, sui magistratūs Capuae essent, L.: in suā potestate sunt, suo iure utuntur.
     
    E. In particular connections, strengthened by ipse (agreeing with the antecedent): valet ipsum (ingenium eius) suis viribus, by its own strength: legio Martia non ipsa suis decretis hostem iudicavit Antonium? by its own resolutions: suāmet ipsae fraude omnes interierunt, L.: alios sua ipsos invidia interemit, L. —Distributively, with quisque, each...his own, severally...their own: suum quisque noscat ingenium, let every man understand his own mind: celeriter ad suos quisque ordines rediit, Cs.: ut omnes in suis quisque centuriis primā luce adessent, each in his own centuria, L.: sua cuiusque animantis natura est: ne suus cuique domi hostis esset, L.: trahit sua quemque voluptas, V.: in tribuendo suum cuique: clarissimorum suae cuiusque gentis virorum mors, L.: hospitibus quisque suis scribebant, L.
     
    • With quisque in the same case (by attraction): in sensibus sui cuiusque generis iudicium (i. e. suum cuiusque generis iudicium): equites suae cuique parti post principia conlocat (i. e. equites suos cuique parti), L.: pecunia, quae suo quoque anno penderetur (i. e. suo quaeque anno), each instalment in the year when due, L.
     
    • With uterque, distributively (of two subjects): suas uterque legiones reducit in castra, Cs.: cum sui utrosque adhortarentur, L.
     
    • Strengthened by sibi, own (colloq.): Suo sibi gladio hunc iugulo, his own sword, T.; cf. idem lege sibi suā curationem petet, for himself.
     
    • Strengthened by unius: ut sua unius in his gratia esset, that the credit of it should belong to him alone, L.: qui de suā unius sententiā omnia gerat, L.
     
    • With a pron, of his, of hers, of theirs: postulat ut ad hanc suam praedam adiutores vos profiteamini, to this booty of his: cum illo suo pari: nullo suo merito, from no fault of theirs, L.
     
    • With an adj. (suus usu. emphatic, preceding the adj.): suis amplissimis fortunis: simili ratione Pompeius in suis veteribus castris consedit, Cs.: propter summam suam humanitatem: in illo ardenti tribunatu suo.
     
    • For the gen obj. (rare): neque cuiquam mortalium iniuriae suae parvae videntur (i. e. sibi inlatae), S.: te a cognitione suā reppulerunt (i. e. a se cognoscendo).
     
    • Abl sing. fem., with refert or interest, for gen. of the pers. pron: neminem esse qui quo modo se habeat nihil suā censeat interesse; see intersum, rēfert.
     
    • Strengthened by the suffix -pte (affixed to suā or suo; never with ipse): ferri suopte pondere: locus suāpte naturā infestus, L. —Strengthened by the suffix -met (affixed to sua, sui, suo, suā, suos and suis; usu. followed by ipse): suomet ipsi more, S.: intra suamet ipsum moenia, L.: suosmet ipsi cives, L.
    The new script automatically (with -d auto-decline tag) declines and retrieves all possible definitions of a word—no fussing is needed—you can be lazy! :D
    Last edited by bathtime, Feb 26, 2018
    Quasus likes this.
  4. Quasus Civis Illustris

    • Civis Illustris
    Location:
    Coimbra, Portugal
    > Apparently, by running that trim, it just makes the file Linux format?

    Yes, the only difference is that DOS files use CR LF as newlines, whereas in Linux we have LF. So I just removed all CRs.

    Do you have this on github?
    bathtime likes this.
  5. bathtime Member

    Hmmm. Nice. :) And no, it is not on github, but it has crossed my mind to set something up there. It seems like there are not any Latin apps for regular Linux.

    I was thinking, and this is just in thought, to make some of the entries different colours for easier finding.

    *EDIT*

    It's on github now. :)
    Last edited by bathtime, Feb 26, 2018
    Quasus likes this.
  6. bathtime Member

    Just made a new Lewis & Short's Elementary Latin offline Dictionary program in C++ for Linux. This automatically downloads and prepares the XML file. No deps or install required. Program executable is 167kb.

    Example usage:
    Code:
    sum, (2d pers. es, or old ēs; old subj praes. siem, siēs, siet, sient, for sim, etc., T.; fuat for sit, T., V., L.; imperf. often forem, forēs, foret, forent, for essem, etc.; fut. escunt for erunt, C.), fuī (fūvimus for fuimus, Enn. ap. C.), futūrus (inf fut. fore or futūrum esse, C.), esse [ES-; FEV-]
     
    I. As a predicate, asserting existence, to be, exist, live: ut id aut esse dicamus aut non esse: flumen est Arar, quod, etc., Cs.: homo nequissimus omnium qui sunt, qui fuerunt: arbitrari, me nusquam aut nullum fore: fuimus Troes, fuit Ilium, V.
     
    • Of place, to be, be present, be found, stay, live: cum non liceret Romae quemquam esse: cum essemus in castris: deinceps in lege est, ut, etc.: erat nemo, quicum essem libentius quam tecum: sub uno tecto esse, L.
     
    • Of circumstances or condition, to be, be found, be situated, be placed: Sive erit in Tyriis, Tyrios laudabis amictūs, i. e. is attired, O.: in servitute: in magno nomine et gloriā: in vitio: Hic in noxiāst, T.: in pace, L.: (statua) est et fuit totā Graeciā summo honore: ego sum spe bonā: rem illam suo periculo esse, at his own risk: omnem reliquam spem in impetu esse equitum, L.
     
    • In 3 d pers., followed by a pron rel., there is (that) which, there are (persons) who, there are (things) which, some.
     
    • With indic. (the subject conceived as definite): est quod me transire oportet, there is a (certain) reason why I must, etc., T.: sunt item quae appellantur alces, there are creatures also, which, etc., Cs.: sunt qui putant posse te non decedere, some think: Sunt quibus in satirā videor nimis acer, H.
     
    • With subj. (so usu. in prose, and always with a subject conceived as indefinite): sunt, qui putent esse mortem... sunt qui censeant, etc.: est isdem de rebus quod dici possit subtilius: sunt qui Crustis et pomis viduas venentur avaras, H.
     
    • With dat, to belong, pertain, be possessed, be ascribed: fingeret fallacias, Unde esset adulescenti amicae quod daret, by which the youth might have something to give, T.: est igitur homini cum deo similitudo, man has some resemblance: Privatus illis census erat brevis, H.: Troia et huic loco nomen est, L.
     
    • Ellipt.: Nec rubor est emisse palam (sc. ei), nor is she ashamed, O.: Neque testimoni dictio est (sc. servo), has no right to be a witness, T.
     
    • With cum and abl of person, to have to do with, be connected with: tecum nihil rei nobis est, we have nothing to do with you, T.: si mihi tecum minus esset, quam est cum tuis omnibus.
     
    • With ab and abl of person, to be of, be the servant of, follow, adhere to, favor, side with: Ab Andriā est ancilla haec, T.: sed vide ne hoc, Scaevola, totum sit a me, makes for me.
     
    • With pro, to be in favor of, make for: (iudicia) partim nihil contra Habitum valere, partim etiam pro hoc esse.
     
    • With ex, to consist of, be made up of: (creticus) qui est ex longā et brevi et longā: duo extremi chorei sunt, id est, e singulis longis et brevibus.
     
    • To be real, be true, be a fact, be the case, be so: sunt ista, Laeli: est ut dicis, inquam: verum esto: esto, granted, V.
     
    • Esp. in phrases, est ut, it is the case that, is true that, is possible that, there is reason for: sin est, ut velis Manere illam apud te, T.: est, ut id maxime deceat: futurum esse ut omnes pellerentur, Cs.: magis est ut ipse moleste ferat errasse se, quam ut reformidet, etc., i. e. he has more reason for being troubled... than for dreading, etc.: ille erat ut odisset defensorem, etc., he certainly did hate.
     
    • In eo esse ut, etc., to be in a condition to, be possible that, be about to, be on the point of \(impers. or with indef subj.): cum iam in eo esset, ut in muros evaderet miles, when the soldiers were on the point of scaling, L.: cum res non in eo essent ut, etc., L.
     
    • Est ubi, there is a time when, sometimes: est, ubi id isto modo valeat.
     
    • Est quod, there is reason to, is occasion to: etsi magis est, quod gratuler tibi, quam quod te rogem, I have more reason to: est quod referam ad consilium: sin, etc., L.: non est quod multa loquamur, H.
     
    • Est cur, there is reason why: quid erat cur Milo optaret, etc., what cause had Milo for wishing? etc.
     
    • With inf, it is possible, is allowed, is permitted, one may: Est quādam prodire tenus, si non datur ultra, H.: scire est liberum Ingenium atque animum, T.: neque est te fallere quicquam, V.: quae verbo obiecta, verbo negare sit, L.: est videre argentea vasa, Ta.: fuerit mihi eguisse aliquando tuae amicitiae, S.
     
    • Of events, to be, happen, occur, befall, take place: illa (solis defectio) quae fuit regnante Romulo: Amabo, quid tibi est? T.: quid, si... futurum nobis est? L.
     
    • To come, fall, reach, be brought, have arrived: ex eo tempore res esse in vadimonium coepit: quae ne in potestatem quidem populi R. esset, L..
     
    II. As a copula, to be: et praeclara res est et sumus otiosi: non sum ita hebes, ut istud dicam: Nos numerus sumus, a mere number, H.: sic, inquit, est: est ut dicis: frustra id inceptum Volscis fuit, L.: cum in convivio comiter et iucunde fuisses: quod in maritimis facillime sum, am very glad to be.
     
    • With gen part., to be of, belong to: qui eiusdem civitatis fuit, N.: qui Romanae partis erant, L.: ut aut amicorum aut inimicorum Campani simus, L.
     
    • With gen possess., to belong to, pertain to, be of, be the part of, be peculiar to, be characteristic of, be the duty of: audiant eos, quorum summa est auctoritas apud, etc., who possess: ea ut civitatis Rhodiorum essent, L.: Aemilius, cuius tum fasces erant, L.: plebs novarum rerum atque Hannibalis tota esse, were devoted to, L.: negavit moris esse Graecorum, ut, etc.
     
    • With pron possess.: est tuum, Cato, videre quid agatur: fuit meum quidem iam pridem rem p. lugere.
     
    • With gerundive: quae res evertendae rei p. solerent esse, which were the usual causes of ruin to the state: qui utilia ferrent, quaeque aequandae libertatis essent, L.
     
    • With gen. or abl. of quality, to be of, be possessed of, be characterized by, belong to, have, exercise: nimium me timidum, nullius consili fuisse confiteor: Sulla gentis patriciae nobilis fuit, S.: civitas magnae auctoritatis, Cs.: refer, Cuius fortunae (sit), H.: nec magni certaminis ea dimicatio fuit, L.: bellum variā victoriā fuit, S.: tenuissimā valetudine esse, Cs.: qui capite et superciliis semper est rasis.
     
    • With gen. or abl. of price or value, to be of, be valued at, stand at, be appreciated, cost: videtur esse quantivis preti, T.: ager nunc multo pluris est, quam tunc fuit: magni erunt mihi tuae litterae: sextante sal et Romae et per totam Italiam erat, was worth, L.
     
    • With dat predic., to express definition or purpose, to serve for, be taken as, be regarded as, be felt to be: vitam hanc rusticam tu probro et crimini putas esse oportere, ought to be regarded as: eo natus sum ut Iugurthae scelerum ostentui essem, S.: ipsa res ad levandam annonam impedimento fuerat, L.
     
    • With second dat of pers.: quo magis quae agis curae sunt mihi, T.: illud Cassianum, ‘cui bono fuerit,’ the inquiry of Cassius, ‘for whose benefit was it’: haec tam parva civitas praedae tibi et quaestui fuit.
     
    • To be sufficient for, be equal to, be fit: sciant patribus aeque curae fuisse, ne, etc., L.: ut divites conferrent, qui oneri ferendo essent, such as were able to bear the burden, L.: cum solvendo aere (old dat. for aeri) alieno res p. non esset, L.
     
    • With ellips. of aeri: tu nec solvendo eras, wast unable to pay.
     
    • With ad, to be of use for, serve for: res quae sunt ad incendia, Cs.: valvae, quae olim ad ornandum templum erant maxime.
     
    • With de, to be of, treat concerning, relate to: liber, qui est de animo.
     
    • In the phrase, id est, or hoc est, in explanations, that is, that is to say, I mean: sed domum redeamus, id est ad nostros revertamur: vos autem, hoc est populus R., etc., S.
     
     
    amō, āvī, ātus, āre [AM-]
     
    • to love: magis te, quam oculos, T.: unice patriam: dignus amari, V.: non diligi solum, verum etiam amari: a suis et amari et diligi: nescio, ita me di ament, so help me the gods, T.: sic me di amabunt, ut, etc., T.: quam se ipse amans sine rivali! in love with himself: nisi nosmet ipsos valde amabimus.
     
    • To be in love, have an amour: meum gnatum rumor est Amare, T.: insuevit exercitus amare, S.
     
    • Fig., to love, be fond of, find pleasure in: voltum, incessum alicuius: litteras, N.: ea, quae res secundae amant, S.: nemus, H.: amat ianua limen, i. e. is constantly closed, H.: focos, i. e. to make homes, V.: Litus ama, keep close to, V.
     
    • With infin: Hic ames dici pater atque princeps, H.
     
    • Amare aliquem, to be obliged to, be under obligation, have to thank: ecquid nos amas de fidicinā istac? T.: et in Attilii negotio te amavi: bene facis, merito te amo, T.
     
    • Colloq., amabo or amabo te (never vos, etc.), I shall be under obligation to you, and in entreaties, be so good, I pray, I entreat you: id, amabo, adiuta me, T.: cura, amabo te, Ciceronem nostrum: amabo ut illuc transeas, T.: amabo te, ne improbitati meae adsignes, etc.: ego me amavi, was well satisfied with myself.
     
    • Meton., amare with inf, to be fond, be wont, be accustomed: clamore, voltu, aliis omnibus, quae ira fieri amat, S.: Aurum perrumpere amat saxa, H.
     
     
    tōtus, gen. tōtīus, dat. tōtī (m. tōtō, Cs., N., Cu., Pr.) [1 TV-]
     
    • all, all the, all at once, the whole, entire, total: cui senatus totam rem p. commiserat: ut totā mente atque artubus omnibus contremiscam: totā nocte ierunt, all that night, Cs.: per totam urbem, S.: urbe totā: totā in Asiā: in toto orbe terrarum: in totā vitā: totos dies perpotabat, entire days: civitas provinciis totis dabatur: qui se totos tradiderunt voluptatibus: totis viribus adgressus urbem, L.
     
    • In place of an adv., altogether, wholly, entirely, full: in amore est totus, absorbed, T.: Nescio quid meditans nugarum, totus in illis, engrossed, H.: totus et mente et animo in bellum insistit, applied himself wholly, Cs.: virtus in usu sui tota posita est: sum totus vester: falsum est id totum.
     
    • As subst n., all, the whole, opp. dividuom, T.: totum in eo est, ut, etc., all depends on this.
     
    • Ex toto, wholly, completely, entirely, altogether, totally: non ex toto domum suam aversari deos dixit, Cu.: Nec tamen ex toto deserere illa potes, O.
     
    • In toto, upon the whole, in general, generally.
     
    $
    Another Latin program which conjugates all forms of Latin words via internet (Perseus site) into 1st person sg. Program executable is 157kb:

    Example usage:
    Code:
    $ latc quam amor sui
    quam
    quam2
    quam3
    quam5
    quam6
    quam7
    qui
    qui2
    amo
    amor
    sui
    suo
    sus
    suus
    $
    Finally, an example of both applications in unison:
    Code:
    $ lat $(latc amor sui)
     
    amō, āvī, ātus, āre [AM-]
     
     • to love: magis te, quam oculos, T.: unice patriam: dignus amari, V.: non diligi solum, verum etiam amari: a suis et amari et diligi: nescio, ita me di ament, so help me the gods, T.: sic me di amabunt, ut, etc., T.: quam se ipse amans sine rivali! in love with himself: nisi nosmet ipsos valde amabimus.
     
     • To be in love, have an amour: meum gnatum rumor est Amare, T.: insuevit exercitus amare, S.
     
     • Fig., to love, be fond of, find pleasure in: voltum, incessum alicuius: litteras, N.: ea, quae res secundae amant, S.: nemus, H.: amat ianua limen, i. e. is constantly closed, H.: focos, i. e. to make homes, V.: Litus ama, keep close to, V.
     
     • With infin: Hic ames dici pater atque princeps, H.
     
     • Amare aliquem, to be obliged to, be under obligation, have to thank: ecquid nos amas de fidicinā istac? T.: et in Attilii negotio te amavi: bene facis, merito te amo, T.
     
     • Colloq., amabo or amabo te (never vos, etc.), I shall be under obligation to you, and in entreaties, be so good, I pray, I entreat you: id, amabo, adiuta me, T.: cura, amabo te, Ciceronem nostrum: amabo ut illuc transeas, T.: amabo te, ne improbitati meae adsignes, etc.: ego me amavi, was well satisfied with myself.
     
     • Meton., amare with inf, to be fond, be wont, be accustomed: clamore, voltu, aliis omnibus, quae ira fieri amat, S.: Aurum perrumpere amat saxa, H. 
     
     
    amor, ōris, m. [AM-]
     
     • love, affection, strong friendly feeling: amor, ex quo amicitia nominata: amor erga me: amores hominum in te: patrius, for a son, V.: fraternus, for a brother, Cs.
     
     • Esp. of sexual love: in amore haec sunt vitia, T.: ancillae, H.
     
     • Plur, love-adventures: Solis, O.
     
     • Fig., an eager desire, passion: consulatūs amor: amicitiae: vini, L.: auri, V.: habendi, V.: scribendi, H.: tantus amor casūs cognoscere nostros, V.: in longum ducis amores, my desire (for a song), V.
     
     • Meton., mostly plur, a beloved object, one's love: Pompeius nostri amores: suos addicere amores, O.: primus, my first husband, V.
     
     • A charm to excite love: matri praereptus amor, V.
     
     • Person.: Amor, the god of love, Love, Cupid: Paret Amor dictis, V.
     
     • Plur, Cupids, Loves: nudi, O.: lascivi, H. 
     
     
    suī, (gen.), dat. sibi or sibī, acc. and abl. sē or (more emphatic) sēsē (strengthened sēpse for sē ipse, C.; sēmet, L., H.), sing. and plur, pron. of 3d pers. [suus] 
     
    I. Reflex. 
     
    A. Himself, herself, itself, themselves.
     
     • Referring to the grammatical sub
     
    Acc., as direct obj: si is posset ab eā sese avellere, T.: per eos, ne causam diceret, se eripuit, Cs.: homo se erexit: se a Gallis auro redemisse, L.: se gerere, to behave: ipse enim se quisque diligit: se ipsum conligere.
     
     • With gerundive: ne sui in perpetuum liberandi occasio, Cs.: sui conservandi causā profugere: is sibi legationem ad civitates suscepit, Cs.: propositā sibi morte: Medus infestus sibi, H.: tantos sibi spiritūs sumpserat, Cs.: inimicus ipse sibi putandus est.
     
     • Gen obj.: amans sui virtus: dux oblitus sui: potens sui, H.: caecus amor sui, H.: facultatem sui insequendi ademerat, Cs.
     
     • Acc. or abl., with praepp.: ducit secum virginem, T.: pro se quisque sedulo Faciebant, each one singly, T.: cum pro se quisque tenderent ad portas, L.: equitatum ante se mittit, Cs.: litterae ad se ab amico missae: exercitus, quantum in se fuit, etc., L.
     
     • Referring to a logical subject.
     
     • To a definite subject: multis illi in urbibus reficiendi se et curandi potestas fuit: Faustulo spes fuerat regiam stirpem apud se educari, L.: invenere oppidanos vim hostium ab se arcentes, L.
     
     • To an indefinite subject, oneself: deforme est de se ipsum praedicare: ut, quanti quisque se ipse faciat, tanti fiat ab amicis. 
     
    B. In dependent clauses, as pers. pron. 3 d pers., with reflex. reference, him, her, it, them, he, she, they.
     
     • In gen., referring to the grammatical subject of the principal clause: impetrat a senatu, ut dies sibi prorogaretur: Ubii legatos mittunt, qui doceant... neque ab se fidem laesam, Cs.: in urbibus, quae ad se defecerant, praesidia imposuit, S.
     
     • Referring to a logical subject: a regibus litterae, quibus mihi gratias agant, quod se reges appellaverim: cum legati ad eum venissent oratum, ut sibi ignosceret, Cs.
     
     • In orat. obliquā, referring to the person whose words are reported: nuntium mittit... sese diutius sustinere non posse, Cs.: non sese Gallis, sed Gallos sibi bellum intulisse, Cs.: dato responso (a Thyrreensibus), nullam se novam societatem accepturos, L.
     
     • In subordinate clauses, with subjunct.: qui abs te taciti requirunt, cur sibi hoc oneris imposueris: conclamavit, quid ad se venirent? Cs.: multa pollicens, si se conservasset, N.
     
     • With subj. (sub-oblique), expressing the view of the reported speaker: Caesarem iniuriam facere, qui vectigalia sibi deteriora faceret, Cs.: quod nec paratus... obsecutus esset, credidissetque, cum se vidissent Aetoli, omnia, etc., L.
     
     • Instead of the proper case of is or ipse (to suggest the point of view of the person referred to): Unum hoc scio, esse meritam, ut memor esses sui, T.: quem Caesar, ut erat de se meritus, donatum pronuntiavit, Cs.: statuit urbīs, quae... adversum se opportunissimae erant, circumvenire, S.: centum boves militibus dono dedit, qui secum fuerant, L.. 
     
    C. Idiomatic uses, with ad or apud, to one's house, at home: qui a me petierit ut secum et apud se essem cottidie: Num tibi videtur esse apud sese? in his senses, T.
     
     • Dat pleonast., of the person interested, for himself: quid sibi hic vestitus quaerit? T.: mirantes, quid sibi vellet, L.
     
     • Colloq., with suus (old): Suo sibi gladio hunc iugulo, his very own, T.. 
     
    II. As pron recipr., each other, one another: nuntiatum... patres ac plebem in semet ipsos versos, L.; usu. in the phrase, inter se, one another, each other, mutually, reciprocally: video eos inter se amare, T.: neque solum colent inter se ac diligent: ut neque inter se contingant trabes, Cs.: adhaesiones atomorum inter se: collīs duos propinquos inter se occupat, S. 
     
     
    suō, suī, sūtus, ere [SV-]
     
     • to sew, stitch, sew up, sew together: tegumenta corporum suta: sutis arcent frigora bracis, O.: corticibus suta cavatis alvearia, V.
     
     • Fig.: ne quid... suo suat capiti, devise, T. 
     
     
    sūs, suis, m. and f. [cf. u(/s; Engl. sow, swine]
     
     • a swine, hog, pig, boar, sow: sus quid habet praeter escam?: Saetigerae fetus suis, a young pig, V., L., H., O.
     
     • Prov.: sus Minervam docet (of an ignorant person attempting to instruct one better informed): docebo sus, ut aiunt, oratorem.
     
     • A fish, O. 
     
     
    suus, (suae, monosyl., T.; gen plur. suūm, T.), pron poss. 3d pers. [cf. sui, e(/os] 
     
    I. In gen. 
     
    A. With reflex reference, of oneself, belonging to oneself, his own, her own, his, her, its, their.
     
     • Referring to a subst. expressed or understood, in any gender or case: Caesar copias suas divisit, his, Cs.: in suā sententiā perseverat, Cs.: anteposuit suam salutem meae: suos parentes reperire, T.: omne animal et se ipsum et omnīs partīs suas diligit, its: (legiones) si consulem suum reliquerunt, their: naves cum suis oneribus, with their several cargoes, L.: suae causae confidere: hunc sui cives e civitate eiecerunt, was exiled by his fellow-citizens: ipsum suo nomine diligere, for his own sake: suis flammis delete Fidenas, i. e. the flames kindled by the Fidenates, L.: (Siculis ereptae sunt) suae leges: Scipio suas res Syracusanis restituit, L.: inimicissimus suus: Clodius, suus atque illius familiaris, Cs.: diffidens rebus suis: Caesar, primum suo deinde omnium ex conspectu remotis equis, etc., Cs.: doloris sui de me declarandi potestas.
     
     • Rarely with a subj clause as antecedent: secutum suā sponte est, ut, etc., of course, L.
     
     • Without a grammatical antecedent, one's, one's own: si quidem est atrocius, patriae parentem quam suum occidere: in suā civitate vivere: levius est sua decreta tollere quam aliorum, L.
     
     • Referring to an antecedent determined by the context, and conceived as authority for the statement, or as entertaining the thought, his, her, its, their: (Clodius) Caesaris potentiam suam esse dicebat: hostes viderunt... suorum tormentorum usum spatio propinquitatis interire, Cs.: ne ea quae rei p. causā egerit (Pompeius) in suam (i. e. Caesaris) contumeliam vertat, Cs.: mulieres viros orantes, ne parricidio macularent partūs suos (i. e. mulierum), L.. 
     
    B. Without reflex reference, his, her, its, their.
     
     • To avoid ambiguity: petunt rationes illius (Catilinae), ut orbetur auxilio res p., ut minuatur contra suum furorem imperatorum copia (for eius, which might be referred to res p.).
     
     • For emphasis, instead of eius, own, peculiar: mira erant in civitatibus ipsorum furta Graecorum quae magistratūs sui fecerant, their own magistrates.
     
     • Rarely for eius without emphasis (poet. or late): Cimon incidit in eandem invidiam quam pater suus, N.: Ipse sub Esquiliis, ubi erat sua regia Concidit, O. 
     
    II. Esp. 
     
    A. Plur m. as subst., of intimates or partisans, one's people, their own friends: Cupio abducere ut reddam suis, to her family, T.: mulier praecepit suis, omnia Caelio pollicerentur, her slaves: vellem hanc contemptionem pecuniae suis reliquisset, to his posterity: naviculam conscendit cum paucis suis, a few of his followers, Cs.: inprimis inter suos nobilis, his associates: subsidio suorum proelium restituere, comrades, L.: bestias ad opem suis ferendam avertas, their young, L.
     
     • Sing f., a sweetheart, mistress: illam suam suas res sibi habere iussit.
     
     • Sing. and plur n., one's own things, one's property: ad suum pervenire: sui nihil deperdere, Cs.: meum mihi placebat, illi suum, his own work: expendere quid quisque habeat sui, what peculiarities: tibi omnia sua tradere, all he had: se suaque transvehere, their baggage, L.: Aliena melius diiudicare Quam sua, their own business, T.. 
     
    B. Predicative uses, under one's own control, self-possessed, composed: semper esse in disputando suus: Vix sua, vix sanae compos Mentis, O.
     
     • In gen., under one's control, his property, his own: causam dicere aurum quā re sit suum, T.: qui suam rem nullam habent, nothing of their own: ut (Caesar) magnam partem Italiae suam fecerit, has made subject, Cs.: exercitum senatūs populique R. esse, non suum: ne quis quem civitatis mutandae causā suum faceret, made any one his slave, L.: eduxit mater pro suā, as her own, T.: arbitrantur Suam Thaidem esse, devoted to them, T.: Vota suos habuere deos, had the gods on their side, O.. 
     
    C. In phrases, suā sponte, of one's own accord, voluntarily, by oneself, spontaneously, without aid, unprompted: bellum suā sponte suscipere: omne honestum suā sponte expetendum, for its own sake ; see (spons).
     
     • Suus locus, one's own ground: restitit suo loco Romana acies, in its own lines, L.: aciem instruxit suis locis, Cs.. 
     
    D. Praegn., characteristic, peculiar voluptatem suis se finibus tenere iubeamus, within the limits assigned to it.
     
     • Intrinsic, original. (Platoni) duo placet esse motūs, unum suum, alterum externum, etc.
     
     • Private: in suis rebus luxuriosus militibus agros ex suis possessionibus pollicetur, i. e. his private property, Cs.
     
     • Just, due, appropriate: imperatori exercituique honos suus redditus, due to them, L.: is mensibus suis dimisit legionem, i. e. in which each soldier's term ended, L.: suo iure, by his own right: lacrimae sua verba sequuntur, i. e. appropriate (to tears), O.
     
     • Own, peculiar, exclusive, special: mentio inlata est, rem suo proprio magistratu egere, i. e. a special officer, L.: ni suo proprio eum proelio equites exceptum tenuissent, i. e. in which they alone fought, L.: quae est ei (animo) natura? Propria, puto, et sua: equitem suo alienoque Marte pugnare, i. e. both as cavalry and as infantry, L.: Miraturque (arbos) novas frondes et non sua poma (of engrafted fruit), V.
     
     • Own, devoted, friendly, dear: habere suos consules, after his own heart: conlegit ipse se contra suum Clodium, his dear Clodius.
     
     • Own, chosen by himself, favorable, advantageous: suo loco pugnam facere, S.: suis locis bellum in hiemem ducere, Cs.: numquam nostris locis laboravimus, L.: suam occasionem hosti dare, L.: aestuque suo Locros traiecit, a favorable tide, L.: Ventis ire non suis, H.
     
     • Proper, right, regular, normal: si suum numerum naves haberent, their regular complement: numerum non habet illa (ratis) suum, its full number, O.: cum suo iusto equitatu, L.: cessit e vitā suo magis quam suorum civium tempore, the right time for himself: sua tempora exspectare, L.
     
     • Own, independent: ut suae leges, sui magistratūs Capuae essent, L.: in suā potestate sunt, suo iure utuntur. 
     
    E. In particular connections, strengthened by ipse (agreeing with the antecedent): valet ipsum (ingenium eius) suis viribus, by its own strength: legio Martia non ipsa suis decretis hostem iudicavit Antonium? by its own resolutions: suāmet ipsae fraude omnes interierunt, L.: alios sua ipsos invidia interemit, L.
     
     • Distributively, with quisque, each... his own, severally... their own: suum quisque noscat ingenium, let every man understand his own mind: celeriter ad suos quisque ordines rediit, Cs.: ut omnes in suis quisque centuriis primā luce adessent, each in his own centuria, L.: sua cuiusque animantis natura est: ne suus cuique domi hostis esset, L.: trahit sua quemque voluptas, V.: in tribuendo suum cuique: clarissimorum suae cuiusque gentis virorum mors, L.: hospitibus quisque suis scribebant, L.
     
     • With quisque in the same case (by attraction): in sensibus sui cuiusque generis iudicium (i. e. suum cuiusque generis iudicium): equites suae cuique parti post principia conlocat (i. e. equites suos cuique parti), L.: pecunia, quae suo quoque anno penderetur (i. e. suo quaeque anno), each instalment in the year when due, L.
     
     • With uterque, distributively (of two subjects): suas uterque legiones reducit in castra, Cs.: cum sui utrosque adhortarentur, L.
     
     • Strengthened by sibi, own (colloq.): Suo sibi gladio hunc iugulo, his own sword, T.; cf. idem lege sibi suā curationem petet, for himself.
     
     • Strengthened by unius: ut sua unius in his gratia esset, that the credit of it should belong to him alone, L.: qui de suā unius sententiā omnia gerat, L.
     
     • With a pron, of his, of hers, of theirs: postulat ut ad hanc suam praedam adiutores vos profiteamini, to this booty of his: cum illo suo pari: nullo suo merito, from no fault of theirs, L.
     
     • With an adj. (suus usu. emphatic, preceding the adj.): suis amplissimis fortunis: simili ratione Pompeius in suis veteribus castris consedit, Cs.: propter summam suam humanitatem: in illo ardenti tribunatu suo.
     
     • For the gen obj. (rare): neque cuiquam mortalium iniuriae suae parvae videntur (i. e. sibi inlatae), S.: te a cognitione suā reppulerunt (i. e. a se cognoscendo).
     
     • Abl sing. fem., with refert or interest, for gen. of the pers. pron: neminem esse qui quo modo se habeat nihil suā censeat interesse; see intersum, rēfert.
     
     • Strengthened by the suffix -pte (affixed to suā or suo; never with ipse\): ferri suopte pondere: locus suāpte naturā infestus, L.
     
     • Strengthened by the suffix -met (affixed to sua, sui, suo, suā, suos and suis; usu. followed by ipse\): suomet ipsi more, S.: intra suamet ipsum moenia, L.: suosmet ipsi cives, L.
    With this functionality, one could take an entire page of Latin text at once and conjugate them, piping them through 'less' and instantly see the definitions. The application is made such that it fires out results and looks up definitions in realtime whilst piping the results through any chosen program ('less', a text file for study or reference...). The one caveat is that the words must be in the xml dictionary to be displayed, and some of the results that the Perseus site gives are only for the Lewis & Short Dictionary and not the Elementary Ed.:

    Code:
    $ lat $(latc Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur) | less
    Quasus likes this.

Share This Page

 

Our Latin forum is a community for discussion of all topics relating to Latin language, ancient and medieval world.

Latin Boards on this Forum:

English to Latin, Latin to English translation, general Latin language, Latin grammar, Latine loquere, ancient and medieval world links.