-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-nobdict
62 lines (47 loc) · 1.22 KB
/
make-nobdict
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
# -*- mode: Makefile -*-
# Makefile to make nobdict.fst
# the fst just recognises all lemmas in the nobsme dictionary
# it does __not__ translate them.
# usage.
# make -f make-nobdict
# pseudocode:
# read all lexicon files
# pick the lemmas
# save as *lemmalist.txt
# open xfst
# run command "read text < *lemmalist.txt"
# save result as *dict.fst
# the resulting fst to be used to test dict content
XFST = xfst
JV = java
MF = -Xmx2048m
EF = -it:main
XSL = net.sf.saxon.Transform
SRC = src
BIN = bin
SCRIPTS = ../scripts
DICT = get-lemma.xsl
BEGIN = @echo "*** Generating $@-file ***"
END = @echo "Done."
CLEAN = @echo "Cleaning files."
nobdict.fst: bin/nobdict.fst
bin/nobdict.fst: bin/noblemmalist.txt
@echo
@echo "*** Building nobdict.fst ***"
@echo
@printf "read text $< \n\
save stack $@ \n\
quit \n" > ../tmp/nobdict-fst-script
$(XFST) < ../tmp/nobdict-fst-script
@rm -f ../tmp/nobdict-fst-script
noblemmalist.txt: bin/noblemmalist.txt
bin/noblemmalist.txt: $(SRC) \
$(SCRIPTS)/$(DICT)
@echo
$(BEGIN)
$(JV) $(MF) $(XSL) $(EF) $(SCRIPTS)/$(DICT) dir=../nobsme/$< > ../nobsme/$@
@echo
$(END)
@echo
clean:
@rm -f bin/*.txt bin/*.fst