Skip to content

Commit

Permalink
MD abbreviations abbrev1, temp_md_1.
Browse files Browse the repository at this point in the history
  • Loading branch information
funderburkjim committed Sep 18, 2023
1 parent b8b56ec commit 261c57a
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 10 deletions.
11 changes: 11 additions & 0 deletions v02/distinctfiles/md/pywork/mdab/mdab.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DROP TABLE if exists mdab;
CREATE TABLE mdab (
`id` VARCHAR(100) UNIQUE,
`data` TEXT NOT NULL
);
.separator "\t"
.import mdab_input.txt mdab
create index datum on mdab(id);
pragma table_info (mdab);
select count(*) from mdab;
.exit
185 changes: 185 additions & 0 deletions v02/distinctfiles/md/pywork/mdab/mdab_input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
& <id>&</id> <disp>and.</disp>
&amp; <id>&amp;</id> <disp>and.</disp>
&amp;c. <id>&amp;c.</id> <disp>et cetera, and so forth.</disp>
&c. <id>&c.</id> <disp>et cetera, and so forth.</disp>
+ <id>+</id> <disp>with; also.</disp>
= <id>=</id> <disp>equals, is the equivalent of.</disp>
a. <id>a.</id> <disp>adjective.</disp>
A. D. <id>A. D.</id> <disp>Anno Domini</disp>
ab. <id>ab.</id> <disp>ablative.</disp>
abs. <id>abs.</id> <disp>absolute.</disp>
abst. <id>abst.</id> <disp>abstract.</disp>
abst. N. <id>abst. N.</id> <disp>abstract noun.</disp>
ac. <id>ac.</id> <disp>accusative.</disp>
act. <id>act.</id> <disp>active.</disp>
ad. <id>ad.</id> <disp>adverb, -ial, -ially.</disp>
aor. <id>aor.</id> <disp>aorist.</disp>
app. <id>app.</id> <disp>apposition.</disp>
ass. <id>ass.</id> <disp>asseverative.</disp>
athg. <id>athg.</id> <disp>anything.</disp>
AV. <id>AV.</id> <disp>Atharva-veda.</disp>
B. <id>B.</id> <disp>Buddhistic term.</disp>
beg. <id>beg.</id> <disp>beginning.</disp>
bg. <id>bg.</id> <disp>beginning.</disp>
Br. <id>Br.</id> <disp>Brāhmaṇa.</disp>
C. <id>C.</id> <disp>Classical (post-Vedic) Sanskrit.</disp>
cj. <id>cj.</id> <disp>conjunction.</disp>
col. <id>col.</id> <disp>collective, -ly.</disp>
coll. <id>coll.</id> <disp>collective, -ly.</disp>
comm. <id>comm.</id> <disp>commentator.</disp>
conj. <id>conj.</id> <disp>conjecture.</disp>
cor. <id>cor.</id> <disp>correlative.</disp>
cp. <id>cp.</id> <disp>compare.</disp>
cpd. <id>cpd.</id> <disp>compound.</disp>
cpv. <id>cpv.</id> <disp>comparative.</disp>
crt. <id>crt.</id> <disp>certain.</disp>
cs. <id>cs.</id> <disp>causal.</disp>
d. <id>d.</id> <disp>dative.</disp>
dbl. <id>dbl.</id> <disp>double.</disp>
den. <id>den.</id> <disp>denominative.</disp>
der. <id>der.</id> <disp>derivative.</disp>
des. <id>des.</id> <disp>desiderative.</disp>
dim. <id>dim.</id> <disp>diminutive.</disp>
dr. <id>dr.</id> <disp>dramatic term.</disp>
du. <id>du.</id> <disp>dual.</disp>
E. <id>E.</id> <disp>Epic.</disp>
e. g. <id>e. g.</id> <disp>for example.</disp>
emp. <id>emp.</id> <disp>emphatic.</disp>
enc. <id>enc.</id> <disp>enclitic.</disp>
encl. <id>encl.</id> <disp>enclitic.</disp>
Eng. <id>Eng.</id> <disp>English.</disp>
ep. <id>ep.</id> <disp>epithet.</disp>
eq. <id>eq.</id> <disp>equivalent.</disp>
esp. <id>esp.</id> <disp>especially.</disp>
etc. <id>etc.</id> <disp>et cetera, and so forth.</disp>
exc. <id>exc.</id> <disp>except, exceptionally.</disp>
excl. <id>excl.</id> <disp>exclamation.</disp>
exp. <id>exp.</id> <disp>explanation.</disp>
f. <id>f.</id> <disp>feminine; also = for.</disp>
ff. <id>ff.</id> <disp>and the following.</disp>
fig. <id>fig.</id> <disp>figurative, -ly.</disp>
fp. <id>fp.</id> <disp>future participle passive.</disp>
fr. <id>fr.</id> <disp>from.</disp>
ft. <id>ft.</id> <disp>future.</disp>
g. <id>g.</id> <disp>genitive.</disp>
gd. <id>gd.</id> <disp>gerund (indeclinable participle).</disp>
Gk. <id>Gk.</id> <disp>Greek.</disp>
gnly. <id>gnly.</id> <disp>generally.</disp>
gr. <id>gr.</id> <disp>grammatical term.</disp>
hvg. <id>hvg.</id> <disp>having.</disp>
i. e. <id>i. e.</id> <disp>that is.</disp>
id. <id>id.</id> <disp>the same.</disp>
ij. <id>ij.</id> <disp>interjection.</disp>
imps. <id>imps.</id> <disp>impersonal.</disp>
impv. <id>impv.</id> <disp>imperative.</disp>
in. <id>in.</id> <disp>instrumental.</disp>
incor. <id>incor.</id> <disp>incorrect.</disp>
incorr. <id>incorr.</id> <disp>incorrect.</disp>
ind. <id>ind.</id> <disp>indicative.</disp>
indc. <id>indc.</id> <disp>indeclinable.</disp>
indec. <id>indec.</id> <disp>indeclinable.</disp>
indf. <id>indf.</id> <disp>indefinite.</disp>
inf. <id>inf.</id> <disp>infinitive.</disp>
int. <id>int.</id> <disp>intransitive.</disp>
intr. <id>intr.</id> <disp>interrogative.</disp>
intv. <id>intv.</id> <disp>intensive (frequentative).</disp>
ir. <id>ir.</id> <disp>irregular.</disp>
K. <id>K.</id> <disp>king.</disp>
Lat. <id>Lat.</id> <disp>Latin.</disp>
lc. <id>lc.</id> <disp>locative.</disp>
leg. <id>leg.</id> <disp>legal term.</disp>
lit. <id>lit.</id> <disp>literally.</disp>
m. <id>m.</id> <disp>masculine.</disp>
met. <id>met.</id> <disp>metronymic.</disp>
metr. <id>metr.</id> <disp>metrical (due to exigencies of metre).</disp>
mg. <id>mg.</id> <disp>meaning.</disp>
mtn. <id>mtn.</id> <disp>mountain.</disp>
N. <id>N.</id> <disp>name; when alone = name of a man or of a woman.</disp>
n. <id>n.</id> <disp>neuter.</disp>
N.E. <id>N.E.</id> <disp>Northeast.</disp>
N.W. <id>N.W.</id> <disp>Northwest.</disp>
neg. <id>neg.</id> <disp>negative.</disp>
nm. <id>nm.</id> <disp>nominative.</disp>
nr. <id>nr.</id> <disp>numeral.</disp>
num. <id>num.</id> <disp>numeral.</disp>
obj. <id>obj.</id> <disp>object.</disp>
onom. <id>onom.</id> <disp>onomatopœic.</disp>
opp. <id>opp.</id> <disp>opposite.</disp>
opt. <id>opt.</id> <disp>optative.</disp>
or. <id>or.</id> <disp>originally.</disp>
ord. <id>ord.</id> <disp>ordinary.</disp>
orig. <id>orig.</id> <disp>originally.</disp>
P. <id>P.</id> <disp>Parasmaipada.</disp>
pat. <id>pat.</id> <disp>patronymic.</disp>
pcl. <id>pcl.</id> <disp>particle.</disp>
perh. <id>perh.</id> <disp>perhaps.</disp>
pf. <id>pf.</id> <disp>perfect.</disp>
ph. <id>ph.</id> <disp>philosophical term.</disp>
phil. <id>phil.</id> <disp>philosophical term.</disp>
pl. <id>pl.</id> <disp>plural.</disp>
pn. <id>pn.</id> <disp>pronoun, pronominal.</disp>
pos. <id>pos.</id> <disp>possessive.</disp>
poss. <id>poss.</id> <disp>possessive.</disp>
pot. <id>pot.</id> <disp>potential.</disp>
pp. <id>pp.</id> <disp>perfect passive participle.</disp>
Pr. <id>Pr.</id> <disp>Prākrit (Sanskrit equivalent of Prākrit word), Prākritic.</disp>
pr. <id>pr.</id> <disp>present.</disp>
pred. <id>pred.</id> <disp>predicate, predicative, -ly.</disp>
prn. <id>prn.</id> <disp>pronoun, pronominal.</disp>
prob. <id>prob.</id> <disp>probably.</disp>
prop. <id>prop.</id> <disp>properly.</disp>
prp. <id>prp.</id> <disp>preposition.</disp>
prs. <id>prs.</id> <disp>person.</disp>
ps. <id>ps.</id> <disp>passive.</disp>
pt. <id>pt.</id> <disp>participle.</disp>
px. <id>px.</id> <disp>prefix.</disp>
q. v. <id>q. v.</id> <disp>which see.</disp>
R. <id>R.</id> <disp>river.</disp>
red. <id>red.</id> <disp>reduplicated, reduplication. </disp>
rel. <id>rel.</id> <disp>relative.</disp>
rep. <id>rep.</id> <disp>repeated.</disp>
rf. <id>rf.</id> <disp>reflexive.</disp>
rh. <id>rh.</id> <disp>rhetorical term.</disp>
rit. <id>rit.</id> <disp>ritual term.</disp>
rl. <id>rl.</id> <disp>relative.</disp>
rp. <id>rp.</id> <disp>repeated.</disp>
RV. <id>RV.</id> <disp>Rig-veda.</disp>
RV.² <id>RV.²</id> <disp>Rig-veda (² = ?)</disp>
RV.¹ <id>RV.¹</id> <disp>Rig-veda (¹ = ?)</disp>
S. <id>S.</id> <disp>Sūtra.</disp>
s. <id>s.</id> <disp>singular.</disp>
s. v. <id>s. v.</id> <disp>sub voce.</disp>
sb. <id>sb.</id> <disp>substantive.</disp>
sc. <id>sc.</id> <disp>scilicet, that is to say, supply.</disp>
sg. <id>sg.</id> <disp>singular.</disp>
sp. <id>sp.</id> <disp>specifically.</disp>
spv. <id>spv.</id> <disp>superlative.</disp>
st. <id>st.</id> <disp>stem.</disp>
sthg. <id>sthg.</id> <disp>something.</disp>
str. <id>str.</id> <disp>strong.</disp>
subj. <id>subj.</id> <disp>subjunctive.</disp>
SV. <id>SV.</id> <disp>Sāma-veda.</disp>
sx. <id>sx.</id> <disp>suffix.</disp>
T. <id>T.</id> <disp>title.</disp>
t. <id>t.</id> <disp>term.</disp>
TBr. <id>TBr.</id> <disp>Taittirīya-Brāhmaṇa.</disp>
tr. <id>tr.</id> <disp>transitive.</disp>
TS. <id>TS.</id> <disp>Taittirīya-Saṃhitā.</disp>
U. <id>U.</id> <disp>Upaniṣad.</disp>
V. <id>V.</id> <disp>Veda, Vedic.</disp>
v. <id>v.</id> <disp>vide, see.</disp>
v. r. <id>v. r.</id> <disp>various reading.</disp>
vb. <id>vb.</id> <disp>verb.</disp>
vbl. <id>vbl.</id> <disp>verbal.</disp>
vbl. N. <id>vbl. N.</id> <disp>verbal noun.</disp>
vc. <id>vc.</id> <disp>vocative.</disp>
VS. <id>VS.</id> <disp>Vājasaneyi-Saṃhitā.</disp>
w. <id>w.</id> <disp>with.</disp>
wk. <id>wk.</id> <disp>weak.</disp>
YV. <id>YV.</id> <disp>Yajur-veda.</disp>
± <id>±</id> <disp>with or without.</disp>
Ā. <id>Ā.</id> <disp>Ātmanepada.</disp>
ŚB. <id>ŚB.</id> <disp>Śatapatha-Brāhmaṇa.</disp>
ɴ. <id>ɴ.</id> <disp>noun.</disp>
√ <id>√</id> <disp>root.</disp>
𝑃. <id>𝑃.</id> <disp>Purāṇa.</disp>
3 changes: 3 additions & 0 deletions v02/distinctfiles/md/pywork/mdab/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# to update, work with abbrev_input.txt
sh redo.sh
4 changes: 4 additions & 0 deletions v02/distinctfiles/md/pywork/mdab/redo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "making mdab.sqlite from mdab_input.txt"
sh redo_mdab.sh
echo "moving mdab.sqlite to web/sqlite/"
mv mdab.sqlite ../../web/sqlite/
5 changes: 5 additions & 0 deletions v02/distinctfiles/md/pywork/mdab/redo_mdab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo "remaking mdab.sqlite"
rm mdab.sqlite
sqlite3 mdab.sqlite < mdab.sql
echo "finished remaking mdab.sqlite"
chmod 0755 mdab.sqlite
10 changes: 5 additions & 5 deletions v02/inventory.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ pw pwg:pywork/make_xml_ls.py:CD
; Later, try to get all abbreviations to be the same,
; so templates can be used.
; also xxx to redo_postxml.sh for abbreviations
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs:pywork/${dictlo}ab/${dictlo}ab.sql:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs:pywork/${dictlo}ab/${dictlo}ab_input.txt:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs:pywork/${dictlo}ab/readme.txt:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs:pywork/${dictlo}ab/redo.sh:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs:pywork/${dictlo}ab/redo_${dictlo}ab.sh:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs md:pywork/${dictlo}ab/${dictlo}ab.sql:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs md:pywork/${dictlo}ab/${dictlo}ab_input.txt:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs md:pywork/${dictlo}ab/readme.txt:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs md:pywork/${dictlo}ab/redo.sh:CD
ben stc bur cae mw pw pwkvn pwg lan gra ap90 bhs md:pywork/${dictlo}ab/redo_${dictlo}ab.sh:CD
mw:pywork/${dictlo}ab/check.py:CD
; --------------------------------------------------------------
; -- literary sources: MW
Expand Down
22 changes: 18 additions & 4 deletions v02/makotemplates/pywork/make_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,13 @@ def dig_to_xml_specific(x):
# change -- to mdash
x = re.sub(r'--',u'—',x)
# change ‡ to _ (two vowels that will be combined via sandhi)
x = re.sub(u'‡','_',x)
# x = re.sub(u'‡','_',x)
x = re.sub(u'‡','‿',x) # 09-13-2023. u+203f Undertie
# remove the ¤ symbol. It brackets some numbers (e.g. ¤2¤) but there
# is no obvious typographical feature.
x = re.sub(u'¤','',x)
# change <g>X</g> to <lang n="greek">x</lang>
x = re.sub(r'<g>(.*?)</g>',r'<lang n="greek">\1</lang>',x)
# change <g>X</g> to <lang n="greek">x</lang> # 09-14-2023 comment out
# x = re.sub(r'<g>(.*?)</g>',r'<lang n="greek">\1</lang>',x)
if divflag:
# add divs for <b>-
x = re.sub(r'<b>-','<div n="1" ><b>-',x)
Expand Down Expand Up @@ -687,7 +688,7 @@ def construct_xmlstring(datalines,hwrec):
datalines1.append(x)
datalines = datalines1
%endif
%if dictlo in ['md','shs','skd','vcp']:
%if dictlo in ['shs','skd','vcp']:
for i,x in enumerate(datalines):
if i == 0:
pass
Expand All @@ -703,6 +704,19 @@ def construct_xmlstring(datalines,hwrec):
datalines1.append(x)
datalines = datalines1
%endif
%if dictlo in ['md']:
for i,x in enumerate(datalines):
if i == 0:
pass
elif x.strip() == '':
pass
elif x.startswith('[Page'):
pass
else:
x = '<lb/>' + x
datalines1.append(x)
datalines = datalines1
%endif
%if dictlo in ['pe','pgn','pui','vei']:
for i,x in enumerate(datalines):
if i == 0:
Expand Down
2 changes: 1 addition & 1 deletion v02/makotemplates/pywork/redo_postxml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sh redo.sh
cd ../ # back to pywork
# For applicable dictionaries, update other web/sqlite databases
# abbreviations
%if dictlo in ['ben','stc','bur','cae','mw','pw','pwg','lan','gra','ap90','pwkvn','bhs']:
%if dictlo in ['ben','stc','bur','cae','mw','pw','pwg','lan','gra','ap90','pwkvn','bhs','md']:
cd ${dictlo}ab
sh redo.sh
cd ../ # back to pywork
Expand Down

0 comments on commit 261c57a

Please sign in to comment.