lgram

A command-line utility for drilling Latin grammar.
git clone git://git.jtobin.io/lgram.git
Log | Files | Refs | README

pron (10664B)


      1 #!/usr/bin/env bash
      2 
      3 # e.g.
      4 
      5 # ego (personalia, nominativus)
      6 #
      7 # I
      8 #
      9 # example: I am a man
     10 
     11 # meus (possessiva, masculinum)
     12 #
     13 # mine
     14 #
     15 # example: that boy is mine
     16 
     17 # eius (demonstrativa, gen, masculinum, singularis)
     18 #
     19 # example: the book of that man (his)
     20 
     21 # pron, type, case, translation, gender, number, english example
     22 
     23 DATA=$(cat << EOF
     24 ego,persōnālia,nōm,NA,NA,I,I am a man
     25 tū,persōnālia,nōm,NA,NA,you,you are a man
     26 nōs,persōnālia,nōm,NA,NA,we,we are men
     27 vōs,persōnālia,nōm,NA,NA,you all,you are men
     28 mē,persōnālia,acc,NA,NA,me,you see me
     29 tē,persōnālia,acc,NA,NA,you,I see you
     30 sē,persōnālia,acc,NA,NA,him/her/it,I see him
     31 nōs,persōnālia,acc,NA,NA,us,they see us
     32 vōs,persōnālia,acc,NA,NA,you all,they see you
     33 mihi,persōnālia,dat,NA,NA,to me,she gives it to me
     34 tibi,persōnālia,dat,NA,NA,to you,she gives it to you
     35 sibi,persōnālia,dat,NA,NA,to him/her/it,she gives it to him
     36 nōbis,persōnālia,dat,NA,NA,to us,she gives it to us
     37 vōbis,persōnālia,dat,NA,NA,to you all,she gives it to you
     38 mē,persōnālia,abl,NA,NA,by me,she stands by me
     39 tē,persōnālia,abl,NA,NA,by you,she stands by you
     40 sē,persōnālia,abl,NA,NA,by him/her/it,she stands by him
     41 nōbis,persōnālia,abl,NA,NA,by us,she stands by us
     42 vōbis,persōnālia,abl,NA,NA,by you all,she stands by you
     43 meus,possessīva,NA,masculīnum,NA,NA,mine,that boy is mine
     44 mea,possessīva,NA,fēminīnum,NA,NA,mine,that girl is mine
     45 meum,possessīva,NA,neutrum,NA,NA,mine,that thing is mine
     46 tuus,possessīva,NA,masculīnum,NA,NA,yours,that boy is yours
     47 tua,possessīva,NA,fēminīnum,NA,NA,yours,that girl is yours
     48 tuum,possessīva,NA,neutrum,NA,NA,yours,that thing is yours
     49 suus,possessīva,NA,masculīnum,NA,NA,his/hers/its,that boy is his
     50 sua,possessīva,NA,fēminīnum,NA,NA,his/hers/its,that girl is his
     51 suum,possessīva,NA,neutrum,NA,NA,his/hers/its,that thing is his
     52 noster,possessīva,NA,masculīnum,NA,NA,ours,that boy is ours
     53 nostra,possessīva,NA,fēminīnum,NA,NA,ours,that girl is ours
     54 nostrum,possessīva,NA,neutrum,NA,NA,ours,that thing is ours
     55 vester,possessīva,NA,masculīnum,NA,NA,ye'res (irishism),that boy is ye'res
     56 vestra,possessīva,NA,fēminīnum,NA,NA,ye'res (irishism),that girl is ye'res
     57 vestrum,possessīva,NA,neutrum,NA,NA,ye'res (irishism),that thing is ye'res
     58 is,dēmōnstrātīva,nōm,masculīnum,NA,singulāris,he,that man is happy
     59 iī,dēmōnstrātīva,nōm,masculīnum,NA,plūrālis,they,those men are happy
     60 ea,dēmōnstrātīva,nōm,fēminīnum,NA,singulāris,she,that woman is happy
     61 eae,dēmōnstrātīva,nōm,fēminīnum,NA,plūrālis,they,those women are happy
     62 id,dēmōnstrātīva,nōm,neutrum,NA,singulāris,it,that thing is blue
     63 ea,dēmōnstrātīva,nōm,neutrum,NA,plūrālis,they,those things are blue
     64 eum,dēmōnstrātīva,acc,masculīnum,singulāris,him,behold that man
     65 eōs,dēmōnstrātīva,acc,masculīnum,plūrālis,them,behold those men
     66 eam,dēmōnstrātīva,acc,fēminīnum,singulāris,her,behold that woman
     67 eās,dēmōnstrātīva,acc,fēminīnum,plūrālis,them,behold those women
     68 id,dēmōnstrātīva,acc,neutrum,singulāris,it,behold that thing
     69 ea,dēmōnstrātīva,acc,neutrum,plūrālis,them,behold those things
     70 eius,dēmōnstrātīva,gen,masculīnum,singulāris,of his,the book of that man
     71 eōrum,dēmōnstrātīva,gen,masculīnum,plūrālis,of theirs,the book of those men
     72 eius,dēmōnstrātīva,gen,fēminīnum,singulāris,of hers,the book of that woman
     73 eārum,dēmōnstrātīva,gen,fēminīnum,plūrālis,of theirs,the book of those women
     74 eius,dēmōnstrātīva,gen,neutrum,singulāris,of it,the book of that thing
     75 eōrum,dēmōnstrātīva,gen,neutrum,plūrālis,of theirs,the book of those things
     76 eī,dēmōnstrātīva,dat,masculīnum,singulāris,to him,give the book to that man
     77 iīs,dēmōnstrātīva,dat,masculīnum,plūrālis,to them,give the book to those men
     78 eī,dēmōnstrātīva,dat,fēminīnum,singulāris,to her,give the book to that woman
     79 iīs,dēmōnstrātīva,dat,fēminīnum,plūrālis,to them,give the book to those women
     80 eī,dēmōnstrātīva,dat,neutrum,singulāris,to it,give the book to that thing
     81 iīs,dēmōnstrātīva,dat,neutrum,plūrālis,to them,give the book to those things
     82 eō,dēmōnstrātīva,abl,masculīnum,singulāris,about him,I don't want to talk about that man
     83 iīs,dēmōnstrātīva,abl,masculīnum,plūrālis,about them,I don't want to talk about those men
     84 eā,dēmōnstrātīva,abl,fēminīnum,singulāris,about her,I don't want to talk about that woman
     85 iīs,dēmōnstrātīva,abl,fēminīnum,plūrālis,about them,I don't want to talk about those women
     86 eō,dēmōnstrātīva,abl,neutrum,singulāris,about it,I don't want to talk about that thing
     87 iīs,dēmōnstrātīva,abl,neutrum,plūrālis,about them,I don't want to talk about those things
     88 hic,dēmōnstrātīva,nōm,masculīnum,singulāris,he,this man is happy
     89 hī,dēmōnstrātīva,nōm,masculīnum,plūrālis,they,these men are happy
     90 
     91 # translations need work; these are more 'this' and 'that'
     92 # https://booksnbackpacks.com/latin-demonstrative-pronouns/
     93 
     94 haec,dēmōnstrātīva,nōm,fēminīnum,singulāris,she,this woman is happy
     95 hae,dēmōnstrātīva,nōm,fēminīnum,plūrālis,they,these women are happy
     96 hoc,dēmōnstrātīva,nōm,neutrum,singulāris,this,this thing is blue
     97 haec,dēmōnstrātīva,nōm,neutrum,plūrālis,these,these things are blue
     98 hunc,dēmōnstrātīva,acc,masculīnum,singulāris,him,behold this man
     99 hōs,dēmōnstrātīva,acc,masculīnum,plūrālis,them,behold these men
    100 hanc,dēmōnstrātīva,acc,fēminīnum,singulāris,her,behold this woman
    101 hās,dēmōnstrātīva,acc,fēminīnum,plūrālis,them,behold these women
    102 hoc,dēmōnstrātīva,acc,neutrum,singulāris,it,behold this thing
    103 haec,dēmōnstrātīva,acc,neutrum,plūrālis,them,behold these things
    104 huius,dēmōnstrātīva,gen,masculīnum,singulāris,of his,the book of this man
    105 hōrum,dēmōnstrātīva,gen,masculīnum,plūrālis,of theirs,the book of these men
    106 huius,dēmōnstrātīva,gen,fēminīnum,singulāris,of hers,the book of this woman
    107 hārum,dēmōnstrātīva,gen,fēminīnum,plūrālis,of theirs,the book of these women
    108 huius,dēmōnstrātīva,gen,neutrum,singulāris,of it,the book of this thing
    109 hōrum,dēmōnstrātīva,gen,neutrum,plūrālis,of theirs,the book of these things
    110 huic,dēmōnstrātīva,dat,masculīnum,singulāris,to him,give the book to this man
    111 hīs,dēmōnstrātīva,dat,masculīnum,plūrālis,to them,give the book to these men
    112 huic,dēmōnstrātīva,dat,fēminīnum,singulāris,to her,give the book to this woman
    113 hīs,dēmōnstrātīva,dat,fēminīnum,plūrālis,to them,give the book to these women
    114 huic,dēmōnstrātīva,dat,neutrum,singulāris,to it,give the book to this thing
    115 hīs,dēmōnstrātīva,dat,neutrum,plūrālis,to them,give the book to these things
    116 hōc,dēmōnstrātīva,abl,masculīnum,singulāris,about him,I don't want to talk about this man
    117 hīs,dēmōnstrātīva,abl,masculīnum,plūrālis,about them,I don't want to talk about these men
    118 hāc,dēmōnstrātīva,abl,fēminīnum,singulāris,about her,I don't want to talk about this woman
    119 hīs,dēmōnstrātīva,abl,fēminīnum,plūrālis,about them,I don't want to talk about these women
    120 hōc,dēmōnstrātīva,abl,neutrum,singulāris,about it,I don't want to talk about this thing
    121 hīs,dēmōnstrātīva,abl,neutrum,plūrālis,about them,I don't want to talk about these things
    122 ille,dēmōnstrātīva,nōm,masculīnum,singulāris,he,that man is happy
    123 illī,dēmōnstrātīva,nōm,masculīnum,plūrālis,they,those men are happy
    124 illa,dēmōnstrātīva,nōm,fēminīnum,singulāris,she,that woman is happy
    125 illae,dēmōnstrātīva,nōm,fēminīnum,plūrālis,they,those women are happy
    126 illud,dēmōnstrātīva,nōm,neutrum,singulāris,that,that thing is blue
    127 illa,dēmōnstrātīva,nōm,neutrum,plūrālis,those,those things are blue
    128 illum,dēmōnstrātīva,acc,masculīnum,singulāris,him,behold that man
    129 illōs,dēmōnstrātīva,acc,masculīnum,plūrālis,them,behold those men
    130 illam,dēmōnstrātīva,acc,fēminīnum,singulāris,her,behold that woman
    131 illās,dēmōnstrātīva,acc,fēminīnum,plūrālis,them,behold those women
    132 illud,dēmōnstrātīva,acc,neutrum,singulāris,it,behold that thing
    133 illa,dēmōnstrātīva,acc,neutrum,plūrālis,them,behold those things
    134 illīus,dēmōnstrātīva,gen,masculīnum,singulāris,of his,the book of that man
    135 illōrum,dēmōnstrātīva,gen,masculīnum,plūrālis,of theirs,the book of those men
    136 illīus,dēmōnstrātīva,gen,fēminīnum,singulāris,of hers,the book of that woman
    137 illārum,dēmōnstrātīva,gen,fēminīnum,plūrālis,of theirs,the book of those women
    138 illīus,dēmōnstrātīva,gen,neutrum,singulāris,of it,the book of that thing
    139 illōrum,dēmōnstrātīva,gen,neutrum,plūrālis,of theirs,the book of those things
    140 illī,dēmōnstrātīva,dat,masculīnum,singulāris,to him,give the book to that man
    141 illīs,dēmōnstrātīva,dat,masculīnum,plūrālis,to them,give the book to those men
    142 illī,dēmōnstrātīva,dat,fēminīnum,singulāris,to her,give the book to that woman
    143 illīs,dēmōnstrātīva,dat,fēminīnum,plūrālis,to them,give the book to those women
    144 illī,dēmōnstrātīva,dat,neutrum,singulāris,to it,give the book to that thing
    145 illīs,dēmōnstrātīva,dat,neutrum,plūrālis,to them,give the book to those things
    146 illō,dēmōnstrātīva,abl,masculīnum,singulāris,about him,I don't want to talk about that man
    147 illīs,dēmōnstrātīva,abl,masculīnum,plūrālis,about them,I don't want to talk about those men
    148 illā,dēmōnstrātīva,abl,fēminīnum,singulāris,about her,I don't want to talk about that woman
    149 illīs,dēmōnstrātīva,abl,fēminīnum,plūrālis,about them,I don't want to talk about those women
    150 illī,dēmōnstrātīva,abl,neutrum,singulāris,about it,I don't want to talk about that thing
    151 illīs,dēmōnstrātīva,abl,neutrum,plūrālis,about them,I don't want to talk about those things
    152 EOF
    153 )
    154 
    155 prompt() {
    156   read -p '' -n 1 -r <&1
    157   if [[ $REPLY =~ ^[Qq]$ ]]; then
    158     exit 0
    159   fi
    160 }
    161 
    162 IFS="|"
    163 
    164 if [[ ! -z "$@" ]]; then
    165   for arg in "$@"; do
    166     echo $arg
    167     DATA=$(grep -E "$arg" <<< "$DATA")
    168   done
    169 
    170   if [[ -z "$DATA" ]]; then
    171     echo "no results"
    172     exit 1
    173   fi
    174 fi
    175 
    176 LOOP=true
    177 
    178 while $LOOP; do
    179 
    180   clear
    181 
    182   cont=$(shuf -n 1 <<< "$DATA")
    183 
    184   wd=$(cut -f 1 -d, <(echo -n "$cont"))
    185   ty=$(cut -f 2 -d, <(echo -n "$cont"))
    186   ge=$(cut -f 3 -d, <(echo -n "$cont"))
    187   mu=$(cut -f 4 -d, <(echo -n "$cont"))
    188   en=$(cut -f 10 -d, <(echo -n "$cont"))
    189 
    190   echo "$wd ($mu, $ge): $en"
    191 
    192   prompt
    193 
    194   echo "$ty"
    195   echo
    196   echo "nōm:  $(cut -f 5 -d, <<< "$cont")"
    197   echo "acc:  $(cut -f 6 -d, <<< "$cont")"
    198   echo "gen:  $(cut -f 7 -d, <<< "$cont")"
    199   echo "dat:  $(cut -f 8 -d, <<< "$cont")"
    200   echo "abl:  $(cut -f 9 -d, <<< "$cont")"
    201 
    202   prompt
    203 
    204 done