# Makefile to build geographical transducers. # This one is made for a deadline. # To smi and from smi are confused into one transducer. ifeq (victorio.uit.no, $(shell hostname)) XFST = /opt/sami/xerox/c-fsm/ix86-linux2.6-gcc3.4/bin/fst -utf8 endif XFST = xfst HFST_XFST = hfst-xfst HFST_LEXC = hfst-lexc HFST_REGEXP2FST = hfst-regexp2fst HFST_FORMAT = --format=openfst-tropical all: geo.xfst geo.hfst # This goal is to build the final, case-sloppy geo trasducer. geo.xfst: ../bin/geo.xfst ../bin/geo.xfst: ../bin/geo-initcaps.xfst ../bin/caseconv.xfst ../bin/spellrelax.xfst \ ../bin/kommunenummer.xfst @echo @echo "*** Building geo.xfst ***" ; @echo @printf "read regex [[@\"../bin/geo-initcaps.xfst\"] .o. \ [@\"../bin/caseconv.xfst\"] .o. [@\"../bin/spellrelax.xfst\"]] ; \n\ save stack ../bin/geo.xfst \n\ quit \n" > ../tmp/geo-fst-script $(XFST) < ../tmp/geo-fst-script @rm -f ../tmp/geo-fst-script geo.hfst: ../bin/geo.hfst ../bin/geo.hfst: ../bin/geo-initcaps.hfst ../bin/caseconv.hfst ../bin/spellrelax.hfst \ ../bin/kommunenummer.hfst @printf "read regex @\"../bin/geo-initcaps.hfst\" .o. \ @\"../bin/caseconv.hfst\" .o. @\"../bin/spellrelax.hfst\" ; \n\ invert net \n\ save stack ../bin/geo.hfst \n\ quit \n" > ../tmp/geo-hfst-script $(HFST_XFST) < ../tmp/geo-hfst-script @rm -f ../tmp/geo-hfst-script # The second goal is to build the caseconv.xfst file # This goal depends on case.regex caseconv.xfst: ../bin/caseconv.xfst ../bin/caseconv.xfst: invcase.regex @echo @echo "*** Building caseconv.xfst ***" ; @echo @printf "read regex < invcase.regex \n\ save stack ../bin/caseconv.xfst \n\ quit \n" > ../tmp/caseconv-script $(XFST) < ../tmp/caseconv-script @rm -f ../tmp/caseconv-script caseconv.hfst: ../bin/caseconv.hfst ../bin/caseconv.hfst: invcase.regex $(HFST_REGEXP2FST) $(HFST_FORMAT) -S invcase.regex -o ../bin/caseconv.hfst # This goal is to allow for i instead of ï, and for ä/æ and ö/ø mix spellrelax.xfst: ../bin/spellrelax.xfst ../bin/spellrelax.xfst: ${GTLANGS}/lang-sme/src/orthography/spellrelax.regex @echo @echo "*** Building spellrelax.xfst ***" ; @echo @printf "read regex < ${GTLANGS}/lang-sme/src/orthography/spellrelax.regex \n\ save stack ../bin/spellrelax.xfst \n\ quit \n" > ../tmp/spellrelax-sma-script $(XFST) < ../tmp/spellrelax-sma-script @rm -f ../tmp/spellrelax-sma-script spellrelax.hfst: ../bin/spellrelax.hfst ../bin/spellrelax.hfst: ${GTLANGS}/lang-sme/src/orthography/spellrelax.regex $(HFST_REGEXP2FST) $(HFST_FORMAT) -S $(GTLANGS)/lang-sme/src/orthography/spellrelax.regex -o ../bin/spellrelax.hfst # Building the initial geo transducer, the one who wants initial # capital letter only geo-initcaps.xfst: ../bin/geo-initcaps.xfst ../bin/geo-initcaps.xfst: geo.lexc @echo @echo "*** Building geo.xfst ***" ; @echo @printf "read lexc < geo.lexc \n\ save stack ../bin/geo-initcaps.xfst \n\ quit \n" > ../tmp/geo-initcaps-fst-script $(XFST) < ../tmp/geo-initcaps-fst-script @rm -f ../tmp/geo-initcaps-fst-script geo-initcaps.hfst: ../bin/geo-initcaps.hfst ../bin/geo-initcaps.hfst: geo.lexc $(HFST_LEXC) $(HFST_FORMAT) -o ../bin/geo-initcaps.hfst geo.lexc # Building a transducer for identifying Norwegian municipalities kommunenummer.xfst: ../bin/kommunenummer.xfst ../bin/kommunenummer.xfst: kommunenummer.lexc @echo @echo "*** Building a transducer for giving ***" ; @echo "*** Norwegian municipality ID numbers ***" ; @echo @printf "read lexc < kommunenummer.lexc \n\ save stack ../bin/kommunenummer.xfst \n\ quit \n" > ../tmp/kommunenummer-fst-script $(XFST) < ../tmp/kommunenummer-fst-script @rm -f ../tmp/kommunenummer-fst-script kommunenummer.hfst: ../bin/kommunenummer.hfst ../bin/kommunenummer.hfst: kommunenummer.lexc $(HFST_LEXC) $(HFST_FORMAT) -o ../bin/kommunenummer.hfst kommunenummer.lexc clean: @rm -f ../bin/*.xfst @rm -f ../bin/*.hfst