-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.am
169 lines (123 loc) · 6.12 KB
/
Makefile.am
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
###############################################################################
## Makefile for apertium-tur
###############################################################################
LANG1=tur
BASENAME=apertium-$(LANG1)
TARGETS_COMMON = $(LANG1).automorf.hfst $(LANG1).autogen.hfst \
$(LANG1).automorf.bin $(LANG1).autogen.bin $(LANG1).autopgen.bin \
$(LANG1).automorf.att.gz $(LANG1).autogen.att.gz \
$(LANG1).rlx.bin
# This include defines goals for install-modes, .deps/.d and .mode files:
@ap_include@
###############################################################################
## Turkish transducer
###############################################################################
.deps/spellrelax.hfst: dev/spellrelax.twol .deps/.d
hfst-twolc $< -o $@
.deps/$(LANG1).twol.hfst: $(BASENAME).$(LANG1).twol .deps/.d
hfst-twolc $< -o $@
.deps/$(LANG1).RL.lexc: $(BASENAME).$(LANG1).lexc .deps/.d
cat $< | grep -v 'Dir/LR' > $@
.deps/$(LANG1).LR.lexc: $(BASENAME).$(LANG1).lexc .deps/.d
cat $< | grep -v 'Dir/RL' > $@
.deps/$(LANG1).RL.lexc.hfst: .deps/$(LANG1).RL.lexc
hfst-lexc --Werror -v $< -o $@
.deps/$(LANG1).LR.lexc.hfst: .deps/$(LANG1).LR.lexc
hfst-lexc --Werror -v $< -o $@
.deps/$(LANG1).RL.hfst: .deps/$(LANG1).RL.lexc.hfst .deps/$(LANG1).twol.hfst
hfst-compose-intersect -1 .deps/$(LANG1).RL.lexc.hfst -2 .deps/$(LANG1).twol.hfst -o $@
.deps/$(LANG1).LR.hfst: .deps/$(LANG1).LR.lexc.hfst .deps/$(LANG1).twol.hfst
hfst-compose-intersect -1 .deps/$(LANG1).LR.lexc.hfst -2 .deps/$(LANG1).twol.hfst -o $@
$(LANG1).autogen.hfst: .deps/$(LANG1).RL.hfst
hfst-fst2fst -O $< -o $@
$(LANG1).automorf.hfst: .deps/$(LANG1).LR.hfst .deps/spellrelax.hfst
hfst-compose-intersect -1 $< -2 .deps/spellrelax.hfst | hfst-invert | hfst-fst2fst -O -o $@
$(LANG1).autogen.att.gz: $(LANG1).autogen.hfst
hfst-fst2txt $< | gzip -9 -c -n > $@
$(LANG1).automorf.att.gz: $(LANG1).automorf.hfst
hfst-fst2txt $< | gzip -9 -c -n > $@
$(LANG1).autogen.bin: $(LANG1).autogen.att.gz .deps/.d
zcat < $< > .deps/$(LANG1).autogen.att
lt-comp lr .deps/$(LANG1).autogen.att $@
$(LANG1).automorf.bin: $(LANG1).automorf.att.gz .deps/.d
zcat < $< > .deps/$(LANG1).automorf.att
lt-comp lr .deps/$(LANG1).automorf.att $@
###############################################################################
## Debugging transducers (for testvoc)
###############################################################################
debug: .deps/$(LANG1).LR-debug.hfst .deps/$(LANG1).lexc.hfst
.deps/$(LANG1).LR-debug.hfst: $(BASENAME).$(LANG1).lexc .deps/.d
cat $< | grep -v 'Dir/RL' | grep -v 'Use/Circ' > .deps/$(LANG1).LR-debug.lexc
hfst-lexc --Werror -v .deps/$(LANG1).LR-debug.lexc -o .deps/$(LANG1).LR-debug.lexc.hfst
hfst-compose-intersect -1 .deps/$(LANG1).LR-debug.lexc.hfst -2 .deps/$(LANG1).twol.hfst -o $@
.deps/$(LANG1).lexc.hfst: .deps/$(LANG1).RL.lexc.hfst
hfst-fst2fst -O -i $< -o $@
###############################################################################
## Disambiguation rules
###############################################################################
$(LANG1).rlx.bin: $(BASENAME).$(LANG1).rlx $(CGCOMP)
$(CGCOMP) $< $@
###############################################################################
## Postgeneration
###############################################################################
$(LANG1).autopgen.bin: $(BASENAME).post-$(LANG1).dix
lt-comp lr $< $@
###############################################################################
## Spell checker
###############################################################################
$(LANG1).zhfst: .deps/acceptor.default.hfst .deps/errmodel.default.hfst
rm -f $@
zip -j $@ .deps/acceptor.default.hfst .deps/errmodel.default.hfst speller/index.xml
.deps/errmodel.default.hfst: .deps/words.default.hfst .deps/strings.default.hfst
python dev/editdist.py -v -s -d 1 -e '@0@' -i speller/editdist.default.txt -a .deps/acceptor.default.hfst \
| hfst-txt2fst -e '@0@' -o .deps/editdist.default.hfst
hfst-disjunct .deps/strings.default.hfst .deps/editdist.default.hfst \
| hfst-minimise | hfst-repeat -f 1 -t 2 -o .deps/editstrings.default.hfst
hfst-disjunct .deps/words.default.hfst .deps/editstrings.default.hfst \
| hfst-fst2fst -f olw -o $@
.deps/words.default.hfst: speller/words.default.txt
grep -v -e "^#" -e "^$$" $< | hfst-strings2fst -j -o $@
.deps/strings.default.hfst: speller/strings.default.txt .deps/anystar.hfst
grep -v -e "^#" -e "^$$" $< | hfst-strings2fst -j | hfst-concatenate .deps/anystar.hfst - |\
hfst-concatenate - .deps/anystar.hfst -o $@
.deps/anystar.hfst:
echo "?*;" | hfst-regexp2fst -S -o $@
.deps/acceptor.default.hfst: $(LANG1).autogen.hfst
cat $< | hfst-fst2fst -t | hfst-project --project=lower | hfst-minimise |hfst-fst2fst -f olw -o $@
###############################################################################
## Distribution
###############################################################################
EXTRA_DIST=$(BASENAME).$(LANG1).lexc \
$(BASENAME).$(LANG1).twol \
$(BASENAME).$(LANG1).rlx \
$(BASENAME).post-$(LANG1).dix \
$(LANG1).prob \
dev \
modes.xml
###############################################################################
## Installation stuff
###############################################################################
#
# apertium_tur_dir: This is where the compiled binaries go
# apertium_tur_srcdir: This is where the source files go
apertium_turdir=$(prefix)/share/apertium/$(BASENAME)/
apertium_tur_srcdir=$(prefix)/share/apertium/$(BASENAME)/
EXTRA_TARGETS=$(LANG1).prob
if HAVE_HFSTOSPELL
EXTRA_TARGETS += $(LANG1).zhfst
endif # HAVE_HFSTOSPELL
apertium_tur_DATA=$(TARGETS_COMMON) $(EXTRA_TARGETS) \
$(BASENAME).post-$(LANG1).dix \
$(BASENAME).$(LANG1).lexc \
$(BASENAME).$(LANG1).twol \
$(BASENAME).$(LANG1).rlx
pkgconfigdir = $(prefix)/share/pkgconfig
pkgconfig_DATA = $(BASENAME).pc
noinst_DATA=modes/$(LANG1)-morph.mode
install-data-local: install-modes
uninstall-local: uninstall-modes
CLEANFILES = $(TARGETS_COMMON)
clean-local:
-rm -rf .deps modes
test: all
apertium-regtest test