forked from pjheslin/diogenes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmk.data
93 lines (71 loc) · 3.85 KB
/
mk.data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Rules to make and package lexical data for Diogenes. Wordlists,
# lexica and morphological data need to be built first. See README.md
# for details.
include mk.common
GCIDEVERSION = 0.48.1
GCIDESUM = e227f8f9e720eb0b1b805ecec4eb4e5c1045784ab3871cdebd19c237d1242311
DATAFILES = \
$(DATA)/latin-analyses.txt \
$(DATA)/greek-analyses.txt \
$(DATA)/latin-analyses.idt \
$(DATA)/greek-analyses.idt \
$(DATA)/latin-lemmata.txt \
$(DATA)/greek-lemmata.txt \
$(DATA)/gcide.txt
.SUFFIXES: .txt .idt
all: server/Diogenes/unicode-equivs.pl $(GCIDE)/gcide.dict.dz $(DATAFILES)
data: $(DATAFILES)
server/Diogenes/unicode-equivs.pl:
make -f makefile server/Diogenes/unicode-equivs.pl
$(GCIDE)/gcide.dict.dz:
rm -rf $(GCIDE)
mkdir -p $(GCIDE)
wget -O $(GCIDE)/dict-gcide_$(GCIDEVERSION)_all.deb http://http.debian.net/debian/pool/main/d/dict-gcide/dict-gcide_$(GCIDEVERSION)_all.deb
printf '%s %s\n' $(GCIDESUM) $(GCIDE)/dict-gcide_$(GCIDEVERSION)_all.deb | shasum -c -a 256
cd $(GCIDE) && ar x dict-gcide_$(GCIDEVERSION)_all.deb data.tar.gz
cd $(GCIDE) && zcat < data.tar.gz | tar x ./usr/share/dictd/gcide.dict.dz
mv $(GCIDE)/usr/share/dictd/gcide.dict.dz $@
$(BUILD)/lewis-index.txt: utils/index_lewis.pl $(DATA)/lat.ls.perseus-eng1.xml
mkdir -p $(BUILD)
./utils/index_lewis.pl < $(DATA)/lat.ls.perseus-eng1.xml > $@
$(BUILD)/lewis-index-head.txt: utils/index_lewis_head.pl $(DATA)/lat.ls.perseus-eng1.xml
mkdir -p $(BUILD)
./utils/index_lewis_head.pl < $(DATA)/lat.ls.perseus-eng1.xml > $@
$(BUILD)/lewis-index-trans.txt: utils/index_lewis_trans.pl $(DATA)/lat.ls.perseus-eng1.xml
mkdir -p $(BUILD)
./utils/index_lewis_trans.pl < $(DATA)/lat.ls.perseus-eng1.xml > $@
$(BUILD)/lsj-index.txt: utils/index_lsj.pl $(DATA)/grc.lsj.xml
mkdir -p $(BUILD)
./utils/index_lsj.pl < $(DATA)/grc.lsj.xml > $@
$(BUILD)/lsj-index-head.txt: utils/index_lsj_head.pl $(DATA)/grc.lsj.xml
mkdir -p $(BUILD)
./utils/index_lsj_head.pl < $(DATA)/grc.lsj.xml > $@
$(BUILD)/lsj-index-trans.txt: utils/index_lsj_trans.pl $(DATA)/grc.lsj.xml
mkdir -p $(BUILD)
./utils/index_lsj_trans.pl < $(DATA)/grc.lsj.xml > $@
$(DATA)/latin-analyses.txt: utils/make_latin_analyses.pl $(BUILD)/lewis-index.txt $(BUILD)/lewis-index-head.txt $(BUILD)/lewis-index-trans.txt $(BUILD)/lat.morph
./utils/make_latin_analyses.pl \
$(BUILD)/lewis-index.txt $(BUILD)/lewis-index-head.txt $(BUILD)/lewis-index-trans.txt \
< $(BUILD)/lat.morph | LC_ALL=C sort > $@
$(DATA)/greek-analyses.txt: utils/make_greek_analyses.pl $(BUILD)/lsj-index.txt $(BUILD)/lsj-index-head.txt $(BUILD)/lsj-index-trans.txt $(BUILD)/grc.morph
./utils/make_greek_analyses.pl \
$(BUILD)/lsj-index.txt $(BUILD)/lsj-index-head.txt $(BUILD)/lsj-index-trans.txt \
< $(BUILD)/grc.morph | LC_ALL=C sort > $@
.txt.idt:
./utils/make_index.pl < $< > $@
$(DATA)/latin-lemmata.txt: utils/make_latin_lemmata.pl $(BUILD)/lewis-index.txt $(DATA)/latin-analyses.txt
./utils/make_latin_lemmata.pl $(BUILD)/lewis-index.txt < $(DATA)/latin-analyses.txt > $@
$(DATA)/greek-lemmata.txt: utils/make_greek_lemmata.pl $(BUILD)/lsj-index.txt $(BUILD)/grc.words $(DATA)/greek-analyses.txt
./utils/make_greek_lemmata.pl $(BUILD)/lsj-index.txt $(BUILD)/grc.words < $(DATA)/greek-analyses.txt > $@
# The sed below cuts out a notice at the start of the dictionary file
$(DATA)/gcide.txt: utils/munge_gcide.pl $(GCIDE)/gcide.dict.dz
zcat < $(GCIDE)/gcide.dict.dz | sed '1,102d' | ./utils/munge_gcide.pl > $@
clean-all:
rm -f $(BUILD)/lewis-index.txt $(BUILD)/lewis-index-head.txt $(BUILD)/lewis-index-trans.txt
rm -f $(BUILD)/lsj-index.txt $(BUILD)/lsj-index-head.txt $(BUILD)/lsj-index-trans.txt
rm -rf $(DEPDIR)/gcide $(GCIDE) $(MORPHEUS)
rm -f $(DATAFILES)
clean-data:
rm -f $(BUILD)/lewis-index.txt $(BUILD)/lewis-index-head.txt $(BUILD)/lewis-index-trans.txt
rm -f $(BUILD)/lsj-index.txt $(BUILD)/lsj-index-head.txt $(BUILD)/lsj-index-trans.txt
rm -f $(DATAFILES)