sinclude $(GTLANG)/hyph.mk hyph: hyph-$(GTLANG).fst hyph-$(GTLANG).fst: $(GTLANG)/bin/hyph-$(GTLANG).fst $(GTLANG)/bin/hyph-$(GTLANG).fst: \ $(GTLANG)/bin/hyph-i$(GTLANG).save \ $(GTLANG)/bin/$(GTLANG)-norm.fst \ $(GTLANG)/bin/hyphrules-$(GTLANG).fst @echo @echo "*** Building hyph-$(GTLANG).fst ***" ; @echo @printf "read regex @\"$(GTLANG)/bin/hyph-i$(GTLANG).save\" .o. \n\ @\"$(GTLANG)/bin/$(GTLANG)-norm.fst\" ; \n\ set flag-is-epsilon ON \n" > tmp/fst-script @printf "read regex @\"$(GTLANG)/bin/hyphrules-$(GTLANG).fst\" ;" >> tmp/fst-script @printf "compose net \n\ save stack $@ \n\ quit \n" >> tmp/fst-script $(CFST) < tmp/fst-script @rm -f tmp/fst-script # This goal is to make a regex for hyphenator rules hyphrules: hyphrules.fst hyphrules.fst: $(GTLANG)/bin/hyphrules-$(GTLANG).fst $(GTLANG)/bin/hyphrules-$(GTLANG).fst: $(GTLANG)/src/hyph-$(GTLANG).txt @echo @echo "*** Building hyphrules-$(GTLANG).fst ***" ; @echo printf "source $< \n\ save stack $@ \n\ quit \n" > tmp/hyph-script $(XFST) < tmp/hyph-script rm -f tmp/hyph-script # This goal is to remove the lexically inserted soft hyphen sign from the # upper representation, by putting a further upper level without the ^ sign. # This target should really be renamed to no__soft__hyphen (without underscores) # To be done. nohardhyphen: nohardhyphen.fst nohardhyphen.fst: common/bin/nohardhyphen.fst common/bin/nohardhyphen.fst: common/src/nohardhyphen.regex @echo @echo "*** Building nohardhyphen.fst ***" ; @echo @printf "read regex < $< \n\ save stack $@ \n\ quit \n" > tmp/nohardhyphen-script $(XFST) < tmp/nohardhyphen-script @rm -f tmp/nohardhyphen-script # This is a normative transducer with lexical hyphenation points, used # for lower morphosyntactic representation and upper (hyphenated) wordform. save-ihyph: $(GTLANG)/bin/hyph-i$(GTLANG).save $(GTLANG)/bin/hyph-i$(GTLANG).save: \ $(GTLANG)/bin/twol-hyph-$(GTLANG).bin \ $(NORMFILES) @echo @echo "*** Building hyph-i$(GTLANG).save ***" ; @echo printf "compile-source $(NORMFILES) \n\ read-rules $< \n\ compose-result \n\ invert-result \n\ save-result $@ \n\ quit \n" > tmp/save-script $(LEXC) < tmp/save-script rm -f tmp/save-script # This is a non-inverted version of the previous one. It is used to # generate wordforms with hyphenation mark for input to speller generation, used # for upper morphosyntactic representation and lower wordform. save-hyph: $(GTLANG)/bin/hyph-$(GTLANG).save $(GTLANG)/bin/hyph-$(GTLANG).save: \ $(GTLANG)/bin/twol-hyph-$(GTLANG).bin \ $(NORMFILES) @echo @echo "*** Building hyph-$(GTLANG).save ***" ; @echo printf "compile-source $(NORMFILES) \n\ read-rules $< \n\ compose-result \n\ save-result $@ \n\ quit \n" > tmp/save-script $(LEXC) < tmp/save-script rm -f tmp/save-script hyphen-convert.fst: common/bin/hyphen-convert.fst common/bin/hyphen-convert.fst: common/src/hyphen-convert.regex @echo @echo "*** Building hyphen-convert.fst ***" ; @echo @printf "read regex < $< \n\ save stack $@ \n\ quit \n" > tmp/hyphen-convert-script $(XFST) < tmp/hyphen-convert-script @rm -f tmp/hyphen-convert-script hyphen-remove.fst: common/bin/hyphen-remove.fst common/bin/hyphen-remove.fst: common/src/hyphen-remove.regex @echo @echo "*** Building hyphen-remove.fst ***" ; @echo @printf "read regex < $< \n\ save stack $@ \n\ quit \n" > tmp/hyphen-remove-script $(XFST) < tmp/hyphen-remove-script @rm -f tmp/hyphen-remove-script ##################################### # Hyphenation testing starts here: hyphtest: hyphregression hyphwordtypes hyphregression: \ $(HYPTESTREPDIR)/regression-$(TESTTOOL)-forrest-$(GTLANG)-$(DATE).xml hyphwordtypes: \ $(HYPTESTREPDIR)/wordtypes-$(TESTTOOL)-forrest-$(GTLANG)-$(DATE).xml ##################################### # The final target is a Forrest doc containing the results and some calculated # statistics: $(HYPTESTREPDIR)/%-$(TESTTOOL)-forrest-$(GTLANG)-$(DATE).xml: \ $(HYPTESTREPDIR)/%-$(TESTTOOL)-$(GTLANG)-$(DATE).xml \ $(TESTXSLDIR)/hyphtest2document.xsl @echo @echo "*** Converting to ForrestDoc. Output in: ***" ; @echo @echo "$@" ; @echo @xsltproc \ --param testlang "'$(GTLANG)'" \ --param testtype "'$*'" \ $(TESTXSLDIR)/hyphtest2document.xsl $< | \ xmllint --encode UTF-8 --output $@ --format - ##################################### # Collect test results in a simple but sufficient xml format: .PRECIOUS: $(HYPTESTREPDIR)/%-$(TESTTOOL)-$(GTLANG)-$(DATE).xml $(HYPTESTREPDIR)/%-$(TESTTOOL)-$(GTLANG)-$(DATE).xml: \ tmp/hy-%-$(TESTTOOL)-$(GTLANG).txt \ tmp/hy-%-$(TESTTOOL)-$(GTLANG).txt.out @echo @echo "*** Collecting $* results, transforming to XML. Output: ***" ; @echo @echo "$@" ; @echo script/hyphen-testres.pl \ --$(TESTTOOL) \ --input=$< \ --output=$<.out \ --document=$< \ --date=$(DATE) \ --version="`cat $<.out.version`" \ --toolversion="`cat tmp/hyph-$(TESTTOOL)-version.txt`" \ --xml=$@ ##################################### # Run the actual hyphenation test here: .PRECIOUS: tmp/hy-%-pl-$(GTLANG).txt.out tmp/hy-%-pl-$(GTLANG).txt.out: tmp/hy-%-pl-$(GTLANG).txt @echo @echo "*** Hyphenation testing - $(GTLANG) ***" ; @echo cat $<.f1 | $(HYPHEN) -w -m $(GTLANG)/polderland/$(HYPHPATT) > $@ # Add lexicon signature/version here @echo "nuvviDspeller Divvun" > $@.verstmp @touch userdict $(SPELL) -u8 -0 -m $(GTLANG)/polderland/$(HYPHDIC) < $@.verstmp \ > $@.verstmp2 grep 'version' $@.verstmp2 | cut -f2 > $@.version @rm -f userdict $@.verstmp $@.verstmp2 # Add hyphenator tool version here $(HYPHEN) --version 2> tmp/hyph-$(TESTTOOL)-version.txt ##################################### # Prepare the hyphenation data - # Regression data: tmp/hy-wordtypes-$(TESTTOOL)-$(GTLANG).txt: \ $(GTLANG)/testing/hyphenation.txt \ $(GTLANG)/polderland/$(HYPHPATT) # prepare-hyphentest @echo @echo "*** Preparing hyphenation test data - $(GTLANG) ***" ; @echo grep -v "^#" $< | grep -v "^\s*$$" | grep -v ' .* ' > $@ cut -f1 $@ | tr -d '^' > $@.f1 ##################################### # Prepare the hyphenation data - # Wordtypes data (check hyphenation of a number of different word constructs): tmp/hy-regression-$(TESTTOOL)-$(GTLANG).txt: \ $(GTLANG)/polderland/hyph-regressions.txt \ $(GTLANG)/polderland/$(HYPHPATT) \ prepare-hyphentest @echo @echo "*** Preparing hyphenation test data - $(GTLANG) ***" ; @echo grep -v "^#" $< | grep -v "^\s*$$" | grep -v ' .* ' > $@ cut -f1 $@ | tr -d '^' > $@.f1 ##################################### # Make sure the latest lexicon hyphenation file is used: prepare-hyphentest: @echo @echo "*** Copying hyphenation lexicon file - $(GTLANG) ***" ; @echo cp $(GTLANG)/polderland/$(WINSPELL) $(GTLANG)/polderland/$(HYPHDIC) ##################################### # Make sure the latest pattern hyphenation file is used: $(GTLANG)/polderland/$(HYPHPATT): $(MACPROOFDIST)/$(HYPHPATT) @echo @echo "*** Copying hyphenation pattern lexicon - $(GTLANG) ***" ; @echo cp $(MACPROOFDIST)/$(HYPHPATT) $(GTLANG)/polderland/$(HYPHPATT)