File: lextor.make

package info (click to toggle)
apertium-en-ca 0.8.4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 11,044 kB
  • ctags: 15
  • sloc: xml: 9,313; sh: 457; makefile: 193
file content (79 lines) | stat: -rw-r--r-- 3,561 bytes parent folder | download | duplicates (4)
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
BASENAME=apertium-en-ca
LANG1=en
LANG2=ca
LEXTOR=lextor-data
PREFIX12=$(LANG1)-$(LANG2)
PREFIX21=$(LANG2)-$(LANG1)

LEFT=3
RIGHT=3
SIZE=100

all: 
	@echo "Please provide the lexical selection model you want to train:"
	@echo "'"$(PREFIX12)"' or '"$(PREFIX21)"'"
	@exit 0

$(PREFIX12): $(PREFIX12).lextor

$(PREFIX21): $(PREFIX21).lextor

$(PREFIX12).lextor: $(LEXTOR)/$(LANG1).pos.txt $(LEXTOR)/$(LANG2).tlmodel $(LEXTOR)/$(LANG1).stopwords \
		$(LEXTOR)/$(LANG1).wlist $(PREFIX12).lextormono.bin $(PREFIX12).lextorbil.bin
	apertium-lextor --trainlch $(LEXTOR)/$(LANG1).stopwords $(LEXTOR)/$(LANG1).wlist $(SIZE) $(LEFT) $(RIGHT) \
	$(LEXTOR)/$(LANG1).pos.txt $(LEXTOR)/$(LANG2).tlmodel $(PREFIX12).lextormono.bin \
	$(PREFIX12).lextorbil.bin $@ 2> $(LEXTOR)/$(LANG1).slmodel.log


$(PREFIX21).lextor: $(LEXTOR)/$(LANG2).pos.txt $(LEXTOR)/$(LANG1).tlmodel $(LEXTOR)/$(LANG2).stopwords \
		$(LEXTOR)/$(LANG2).wlist $(PREFIX21).lextormono.bin $(PREFIX21).lextorbil.bin
	apertium-lextor --trainlch $(LEXTOR)/$(LANG2).stopwords $(LEXTOR)/$(LANG2).wlist $(SIZE) $(LEFT) $(RIGHT) \
	$(LEXTOR)/$(LANG2).pos.txt $(LEXTOR)/$(LANG1).tlmodel $(PREFIX21).lextormono.bin \
	$(PREFIX21).lextorbil.bin $@ 2> $(LEXTOR)/$(LANG2).slmodel.log

$(LEXTOR)/$(LANG2).tlmodel: $(LEXTOR)/$(LANG2).stopwords $(LEXTOR)/$(LANG1).wlist-translation $(LEXTOR)/$(LANG2).pos.txt
	apertium-lextor --trainwrd $(LEXTOR)/$(LANG2).stopwords $(LEXTOR)/$(LANG1).wlist-translation $(SIZE) $(LEFT) $(RIGHT) \
	$(LEXTOR)/$(LANG2).pos.txt $@ 2> $(LEXTOR)/$(LANG2).tlmodel.log

$(LEXTOR)/$(LANG1).tlmodel: $(LEXTOR)/$(LANG1).stopwords $(LEXTOR)/$(LANG2).wlist-translation $(LEXTOR)/$(LANG1).pos.txt
	apertium-lextor --trainwrd $(LEXTOR)/$(LANG1).stopwords $(LEXTOR)/$(LANG2).wlist-translation $(SIZE) $(LEFT) $(RIGHT) \
	$(LEXTOR)/$(LANG1).pos.txt $@ 2> $(LEXTOR)/$(LANG1).tlmodel.log

$(LEXTOR)/$(LANG1).pos.txt: $(PREFIX12).automorf.bin $(PREFIX12).prob $(LEXTOR)/$(LANG1).txt
	apertium-preprocess-corpus-lextor . $(PREFIX12) $(LEXTOR)/$(LANG1).txt $@

$(LEXTOR)/$(LANG2).pos.txt: $(PREFIX21).automorf.bin $(PREFIX21).prob $(LEXTOR)/$(LANG2).txt
	apertium-preprocess-corpus-lextor . $(PREFIX21) $(LEXTOR)/$(LANG2).txt $@

$(LEXTOR)/$(LANG1).stopwords: $(LEXTOR)/$(LANG1).pos.txt
	touch $(LEXTOR)/$(LANG1).stopwords

$(LEXTOR)/$(LANG2).stopwords: $(LEXTOR)/$(LANG2).pos.txt
	touch $(LEXTOR)/$(LANG2).stopwords

$(LEXTOR)/$(LANG1).wlist: $(BASENAME).$(LANG1)-lextor.dix
	apertium-gen-wlist-lextor $(BASENAME).$(LANG1)-lextor.dix $@

$(LEXTOR)/$(LANG2).wlist: $(BASENAME).$(LANG2)-lextor.dix
	apertium-gen-wlist-lextor $(BASENAME).$(LANG2)-lextor.dix $@

$(LEXTOR)/$(LANG1).wlist-translation: $(LEXTOR)/$(LANG1).wlist $(PREFIX12).lextormono.bin $(PREFIX12).lextorbil.bin
	apertium-gen-wlist-lextor-translation --mono $(PREFIX12).lextormono.bin \
	--bil $(PREFIX12).lextorbil.bin --wlist $(LEXTOR)/$(LANG1).wlist > $@

$(LEXTOR)/$(LANG2).wlist-translation: $(LEXTOR)/$(LANG2).wlist $(PREFIX21).lextormono.bin $(PREFIX21).lextorbil.bin
	apertium-gen-wlist-lextor-translation --mono $(PREFIX21).lextormono.bin \
	--bil $(PREFIX21).lextorbil.bin --wlist $(LEXTOR)/$(LANG2).wlist > $@

$(LEXTOR)/$(LANG1).txt:
	@echo "Error: File "$(LEXTOR)/$(LANG1).txt" could not be found."
	@echo "Please provide that corpus to train lexical selection models for '"$(LANG1)"'"
	@exit 1

$(LEXTOR)/$(LANG2).txt:
	@echo "Error: File "$(LEXTOR)/$(LANG2).txt" could not be found."
	@echo "Please provide that corpus to train lexical selection models for '"$(LANG2)"'"
	@exit 1

clean:
	rm -f $(PREFIX12).lextor $(PREFIX21).lextor