Poc més
[apertium.git] / apertium-en-ca / lextor.make
blob000bdbfed3ad3fb95b3a08484e4bcd8007de0fa5
1 BASENAME=apertium-en-ca
2 LANG1=en
3 LANG2=ca
4 LEXTOR=lextor-data
5 PREFIX12=$(LANG1)-$(LANG2)
6 PREFIX21=$(LANG2)-$(LANG1)
8 LEFT=3
9 RIGHT=3
10 SIZE=100
12 all:
13 @echo "Please provide the lexical selection model you want to train:"
14 @echo "'"$(PREFIX12)"' or '"$(PREFIX21)"'"
15 @exit 0
17 $(PREFIX12): $(PREFIX12).lextor
19 $(PREFIX21): $(PREFIX21).lextor
21 $(PREFIX12).lextor: $(LEXTOR)/$(LANG1).pos.txt $(LEXTOR)/$(LANG2).tlmodel $(LEXTOR)/$(LANG1).stopwords \
22 $(LEXTOR)/$(LANG1).wlist $(PREFIX12).lextormono.bin $(PREFIX12).lextorbil.bin
23 apertium-lextor --trainlch $(LEXTOR)/$(LANG1).stopwords $(LEXTOR)/$(LANG1).wlist $(SIZE) $(LEFT) $(RIGHT) \
24 $(LEXTOR)/$(LANG1).pos.txt $(LEXTOR)/$(LANG2).tlmodel $(PREFIX12).lextormono.bin \
25 $(PREFIX12).lextorbil.bin $@ 2> $(LEXTOR)/$(LANG1).slmodel.log
28 $(PREFIX21).lextor: $(LEXTOR)/$(LANG2).pos.txt $(LEXTOR)/$(LANG1).tlmodel $(LEXTOR)/$(LANG2).stopwords \
29 $(LEXTOR)/$(LANG2).wlist $(PREFIX21).lextormono.bin $(PREFIX21).lextorbil.bin
30 apertium-lextor --trainlch $(LEXTOR)/$(LANG2).stopwords $(LEXTOR)/$(LANG2).wlist $(SIZE) $(LEFT) $(RIGHT) \
31 $(LEXTOR)/$(LANG2).pos.txt $(LEXTOR)/$(LANG1).tlmodel $(PREFIX21).lextormono.bin \
32 $(PREFIX21).lextorbil.bin $@ 2> $(LEXTOR)/$(LANG2).slmodel.log
34 $(LEXTOR)/$(LANG2).tlmodel: $(LEXTOR)/$(LANG2).stopwords $(LEXTOR)/$(LANG1).wlist-translation $(LEXTOR)/$(LANG2).pos.txt
35 apertium-lextor --trainwrd $(LEXTOR)/$(LANG2).stopwords $(LEXTOR)/$(LANG1).wlist-translation $(SIZE) $(LEFT) $(RIGHT) \
36 $(LEXTOR)/$(LANG2).pos.txt $@ 2> $(LEXTOR)/$(LANG2).tlmodel.log
38 $(LEXTOR)/$(LANG1).tlmodel: $(LEXTOR)/$(LANG1).stopwords $(LEXTOR)/$(LANG2).wlist-translation $(LEXTOR)/$(LANG1).pos.txt
39 apertium-lextor --trainwrd $(LEXTOR)/$(LANG1).stopwords $(LEXTOR)/$(LANG2).wlist-translation $(SIZE) $(LEFT) $(RIGHT) \
40 $(LEXTOR)/$(LANG1).pos.txt $@ 2> $(LEXTOR)/$(LANG1).tlmodel.log
42 $(LEXTOR)/$(LANG1).pos.txt: $(PREFIX12).automorf.bin $(PREFIX12).prob $(LEXTOR)/$(LANG1).txt
43 apertium-preprocess-corpus-lextor . $(PREFIX12) $(LEXTOR)/$(LANG1).txt $@
45 $(LEXTOR)/$(LANG2).pos.txt: $(PREFIX21).automorf.bin $(PREFIX21).prob $(LEXTOR)/$(LANG2).txt
46 apertium-preprocess-corpus-lextor . $(PREFIX21) $(LEXTOR)/$(LANG2).txt $@
48 $(LEXTOR)/$(LANG1).stopwords: $(LEXTOR)/$(LANG1).pos.txt
49 touch $(LEXTOR)/$(LANG1).stopwords
51 $(LEXTOR)/$(LANG2).stopwords: $(LEXTOR)/$(LANG2).pos.txt
52 touch $(LEXTOR)/$(LANG2).stopwords
54 $(LEXTOR)/$(LANG1).wlist: $(BASENAME).$(LANG1)-lextor.dix
55 apertium-gen-wlist-lextor $(BASENAME).$(LANG1)-lextor.dix $@
57 $(LEXTOR)/$(LANG2).wlist: $(BASENAME).$(LANG2)-lextor.dix
58 apertium-gen-wlist-lextor $(BASENAME).$(LANG2)-lextor.dix $@
60 $(LEXTOR)/$(LANG1).wlist-translation: $(LEXTOR)/$(LANG1).wlist $(PREFIX12).lextormono.bin $(PREFIX12).lextorbil.bin
61 apertium-gen-wlist-lextor-translation --mono $(PREFIX12).lextormono.bin \
62 --bil $(PREFIX12).lextorbil.bin --wlist $(LEXTOR)/$(LANG1).wlist > $@
64 $(LEXTOR)/$(LANG2).wlist-translation: $(LEXTOR)/$(LANG2).wlist $(PREFIX21).lextormono.bin $(PREFIX21).lextorbil.bin
65 apertium-gen-wlist-lextor-translation --mono $(PREFIX21).lextormono.bin \
66 --bil $(PREFIX21).lextorbil.bin --wlist $(LEXTOR)/$(LANG2).wlist > $@
68 $(LEXTOR)/$(LANG1).txt:
69 @echo "Error: File "$(LEXTOR)/$(LANG1).txt" could not be found."
70 @echo "Please provide that corpus to train lexical selection models for '"$(LANG1)"'"
71 @exit 1
73 $(LEXTOR)/$(LANG2).txt:
74 @echo "Error: File "$(LEXTOR)/$(LANG2).txt" could not be found."
75 @echo "Please provide that corpus to train lexical selection models for '"$(LANG2)"'"
76 @exit 1
78 clean:
79 rm -f $(PREFIX12).lextor $(PREFIX21).lextor