sinclude $(GTLANG)/hunspell.mk # Hunspell "environment variables" M4FLAGS = -DHUNSPELL # Hunspell source files HSPSRCjava = $(GTLANG)/hunspell/abbr-$(GTLANG).txt \ $(GTLANG)/hunspell/acro-$(GTLANG).txt \ $(GTLANG)/hunspell/adv-$(GTLANG).txt \ $(GTLANG)/hunspell/conjunction-$(GTLANG).txt \ $(GTLANG)/hunspell/interjection-$(GTLANG).txt \ $(GTLANG)/hunspell/numeral-$(GTLANG).txt \ $(GTLANG)/hunspell/particle-$(GTLANG).txt \ $(GTLANG)/hunspell/pp-$(GTLANG).txt \ $(GTLANG)/hunspell/subjunction-$(GTLANG).txt \ $(GTLANG)/hunspell/pronoun-$(GTLANG).txt \ $(GTLANG)/hunspell/num-$(GTLANG).txt HSPSRCfst = $(GTLANG)/hunspell/adj-$(GTLANG).txt \ $(GTLANG)/hunspell/noun-$(GTLANG).txt \ $(GTLANG)/hunspell/propernoun-$(GTLANG).txt \ $(GTLANG)/hunspell/verb-$(GTLANG).txt HSPSRCprefix = $(GTLANG)/hunspell/middle-noun-$(GTLANG).txt HSPJavaMiddle = $(GTLANG)/src/$(GTLANG)-lex.txt HSPSRCnum = $(GTLANG)/hunspell/generated_nums.txt sinclude $(GTLANG)/hunspell.mk # This target must be built with M4FLAGS=-DHUNSPELL hunspellspeller: tmp/all-hsp-$(GTLANG).sorted @echo @echo "*** Making $(GTLANG) hunspell dictionary ***" filter_plx_file $(GTLANG) tmp/all-hsp-$(GTLANG).sorted fix_set.py $(GTLANG) $(GTLANG)/hunspell # Before we compile the hunspell lexicons, we collect all pieces and sort them: tmp/all-hsp-$(GTLANG).sorted: hsp-conversion \ properlist-hsp \ nounlist-hsp \ adjlist-hsp \ verblist-hsp @echo @echo "*** Sorting $(GTLANG) files ***" @echo @if [ ! -d tmp/$(GTLANG) ]; then \ mkdir tmp/$(GTLANG) ; \ fi @egrep -v "^[0-9]" $(GTLANG)/hunspell/num-$(GTLANG).txt > \ $(GTLANG)/hunspell/num-$(GTLANG)-tmp.txt @mv -f $(GTLANG)/hunspell/num-$(GTLANG)-tmp.txt \ $(GTLANG)/hunspell/num-$(GTLANG).txt @LC_ALL=C sort -T tmp/$(GTLANG) -u -o $@ \ $(HSPSRCjava) $(HSPSRCprefix) $(HSPSRCfst) # Here we make a full-form verb file # It requires network access to victorio.uit.no. verblist-hsp: $(GTLANG)/hunspell/verb-$(GTLANG).txt $(GTLANG)/hunspell/verb-$(GTLANG).txt: $(GTLANG)/bin/spellerverbs-$(GTLANG)-plx.fst common/bin/hyphen-remove.fst @echo @echo "*** Building $(GTLANG) full-form verb list for hunspell conversion ***" @echo @rm -f $@ @printf "load stack < $(GTLANG)/bin/spellerverbs-$(GTLANG)-plx.fst \n\ load stack < common/bin/hyphen-remove.fst \n\ turn stack \n\ compose net \n\ lower-side \n\ print words \n\ quit \n" > tmp/verblist-$(GTLANG)-hsp-script # $(SCP) tmp/verblist-$(GTLANG)-hsp-script victorio.uit.no:speller-$(GTLANG)/gt/tmp/ # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) common/bin/hyphen-remove.fst" # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) M4FLAGS=-DHUNSPELL $(GTLANG)/bin/spellerverbs-$(GTLANG)-plx.fst" $(UFST) -f tmp/verblist-$(GTLANG)-hsp-script -q > $@ @rm -f tmp/verblist-$(GTLANG)-hsp-script # Here we make a full-form adj file for hunspell conversion # It requires network access to victorio.uit.no. adjlist-hsp: $(GTLANG)/hunspell/adj-$(GTLANG).txt $(GTLANG)/hunspell/adj-$(GTLANG).txt: $(GTLANG)/bin/spelleradjs-$(GTLANG)-plx.fst common/bin/hyphen-remove.fst @echo @echo "*** Building $(GTLANG) full-form adj list for hunspell conversion ***" @echo @rm -f $@ @printf "load stack < $(GTLANG)/bin/spelleradjs-$(GTLANG)-plx.fst \n\ load stack < common/bin/hyphen-remove.fst \n\ turn stack \n\ compose net \n\ lower-side \n\ print words \n\ quit \n" > tmp/adjlist-$(GTLANG)-hsp-script # $(SCP) tmp/adjlist-$(GTLANG)-hsp-script victorio.uit.no:speller-$(GTLANG)/gt/tmp/ # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) common/bin/hyphen-remove.fst" # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) M4FLAGS=-DHUNSPELL $(GTLANG)/bin/spelleradjs-$(GTLANG)-plx.fst" $(UFST) -f tmp/adjlist-$(GTLANG)-hsp-script -q > $@ @rm -f tmp/adjlist-$(GTLANG)-hsp-script # Here we make a full-form noun file for hunspell conversion # It requires network access to victorio.uit.no. nounlist-hsp: $(GTLANG)/hunspell/noun-$(GTLANG).txt $(GTLANG)/hunspell/noun-$(GTLANG).txt: $(GTLANG)/bin/spellernouns-$(GTLANG)-plx.fst common/bin/hyphen-remove.fst @echo @echo "*** Building $(GTLANG) full-form noun list for hunspell conversion ***" @echo @rm -f $@ @printf "load stack < $(GTLANG)/bin/spellernouns-$(GTLANG)-plx.fst \n\ load stack < common/bin/hyphen-remove.fst \n\ turn stack \n\ compose net \n\ lower-side \n\ print words \n\ quit \n" > tmp/nounlist-$(GTLANG)-hsp-script # $(SCP) tmp/nounlist-$(GTLANG)-hsp-script victorio.uit.no:speller-$(GTLANG)/gt/tmp/ # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) common/bin/hyphen-remove.fst" # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) M4FLAGS=-DHUNSPELL $(GTLANG)/bin/spellernouns-$(GTLANG)-plx.fst" $(UFST) -f tmp/nounlist-$(GTLANG)-hsp-script -q > $@ @rm -f tmp/nounlist-$(GTLANG)-hsp-script # Here we make a full-form propernoun file # It requires network access to victorio.uit.no. properlist-hsp: $(GTLANG)/hunspell/propernoun-$(GTLANG).txt $(GTLANG)/hunspell/propernoun-$(GTLANG).txt: $(GTLANG)/bin/spellerproper-$(GTLANG)-plx.fst common/bin/hyphen-remove.fst @echo @echo "*** Building $(GTLANG) full-form propernoun list for hunspell conversion ***" @echo @rm -f $@ @printf "load stack < $(GTLANG)/bin/spellerproper-$(GTLANG)-plx.fst \n\ load stack < common/bin/hyphen-remove.fst \n\ turn stack \n\ compose net \n\ lower-side \n\ print words \n\ quit \n" > tmp/properlist-$(GTLANG)-hsp-script # $(SCP) tmp/properlist-$(GTLANG)-hsp-script victorio.uit.no:speller-$(GTLANG)/gt/tmp/ # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) common/bin/hyphen-remove.fst" # $(SSH) victorio.uit.no "cd speller-$(GTLANG)/gt && make GTLANG=$(GTLANG) M4FLAGS=-DHUNSPELL $(GTLANG)/bin/spellerproper-$(GTLANG)-plx.fst" $(UFST) -f tmp/properlist-$(GTLANG)-hsp-script -q > $@ @rm -f tmp/properlist-$(GTLANG)-hsp-script hsp-conversion: ifst-norm lexc2xspell $(HSPSRCjava) $(HSPSRCprefix) $(HSPSRCjava): $(SRCS) lexc2xspell $(GTLANG)/src/num-$(GTLANG)-lex.txt @echo @echo "*** Creating $(GTLANG) HSP files ***" @echo java -cp src/lexc2xspell/build Lexc2xspell \ $(patsubst $(GTLANG)/hunspell/%.txt,$(GTLANG)/src/%-lex.txt,$@) \ `pwd`/$(GTLANG)/bin/i$(GTLANG)-norm.fst \ | sed -e 's/\^//g' -e 's/#//g' | uniq > $@ $(HSPSRCprefix): $(HSPJavaMiddle) @echo @echo "*** Creating $(GTLANG) HSP prefix file ***" @echo java -cp src/lexc2xspell/build Lexc2xspell \ $(GTLANG)/src/$(GTLANG)-lex.txt \ `pwd`/$(GTLANG)/bin/i$(GTLANG)-norm.fst \ | sed -e 's/\^//g' -e 's/#//g' | uniq > $@ java -cp src/lexc2xspell/build Lexc2xspell \ $(GTLANG)/src/noun-$(GTLANG)-lex.txt \ `pwd`/$(GTLANG)/bin/i$(GTLANG)-norm.fst \ | sed -e 's/\^//g' -e 's/#//g' | uniq >> $@