## Process this file with automake to produce Makefile.in ## Copyright (C) 2011 Samediggi ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . # Pattern variables to choose tools depending on which toolset we build for: %.hfst : XFST_TOOL = $(HFST_XFST) -p $(VERBOSITY) %.xfst : XFST_TOOL = $(XFST) $(VERBOSITY) %.foma : XFST_TOOL = $(FOMA) $(VERBOSITY) %.hfst : AM_V_XFST_TOOL = $(AM_V_HXFST) %.xfst : AM_V_XFST_TOOL = $(AM_V_XFST) %.foma : AM_V_XFST_TOOL = $(AM_V_FOMA) # Hfst fst variables: GT_COMMON_SPELLER_HFST= # Xerox fst variables - Xerox can be used for building the list-based spellers: GT_COMMON_SPELLER_XFST= GT_COMMON_SPELLER_NAME=speller-gt-norm ####### Automake targets: ######## if WANT_SPELLERS if CAN_HFST GT_COMMON_SPELLER_HFST+=analyser-$(GT_COMMON_SPELLER_NAME).hfst GT_COMMON_SPELLER_HFST+=generator-$(GT_COMMON_SPELLER_NAME).hfst endif # CAN_HFST if CAN_XFST GT_COMMON_SPELLER_XFST+=analyser-$(GT_COMMON_SPELLER_NAME).xfst GT_COMMON_SPELLER_XFST+=generator-$(GT_COMMON_SPELLER_NAME).xfst endif # CAN_XFST #if CAN_FOMA #GT_COMMON_SPELLER_XFST+=analyser-$(GT_COMMON_SPELLER_NAME).foma #GT_COMMON_SPELLER_XFST+=generator-$(GT_COMMON_SPELLER_NAME).foma #endif # CAN_FOMA endif # WANT_SPELLERS noinst_DATA=$(GT_COMMON_SPELLER_HFST) $(GT_COMMON_SPELLER_XFST) # Build the common speller transducer by removing everything we don't want in # any of the spellers: analyser-$(GT_COMMON_SPELLER_NAME).tmp.%: \ $(top_builddir)/src/analyser-raw-gt-desc.% \ $(top_builddir)/src/filters/remove-dialect-tags.% \ $(top_builddir)/src/filters/remove-semantic-tags.% \ $(top_builddir)/src/filters/remove-transitivity-tags.% \ $(top_builddir)/src/filters/remove-variant-tags.% \ $(top_builddir)/src/filters/remove-CLB-strings.% \ $(top_builddir)/src/filters/remove-error-strings.% \ $(top_builddir)/src/filters/remove-MinusSpell-strings.% \ $(top_builddir)/src/filters/remove-PUNCT-strings.% \ $(top_builddir)/src/filters/remove-use_marg-strings.% \ $(top_builddir)/src/filters/remove-orig_lang-tags.% \ $(top_builddir)/src/filters/remove-usage_except_speller-tags.% \ $(top_builddir)/src/orthography/downcase-derived_proper-strings.compose.% $(AM_V_XFST_TOOL)$(PRINTF) "read regex \ @\"$(top_builddir)/src/filters/remove-usage_except_speller-tags.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-dialect-tags.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-orig_lang-tags.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-semantic-tags.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-transitivity-tags.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-variant-tags.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-CLB-strings.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-error-strings.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-MinusSpell-strings.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-PUNCT-strings.$*\" \ .o. @\"$(top_builddir)/src/filters/remove-use_marg-strings.$*\" \ .o. @\"$<\" \ .o. @\"$(top_builddir)/src/orthography/downcase-derived_proper-strings.compose.$*\" \ ;\n\ save stack $@\n\ quit\n" | $(XFST_TOOL) #### HFST transducer fallback target: #### - inversion is needed FOR THE ANALYSER because the hfst model is upside #### down compared to Xerox AT LOOKUP TIME. analyser%.hfst: analyser%.tmp.hfst \ $(top_builddir)/src/filters/remove-hyphenation-marks.hfst \ $(top_builddir)/src/filters/remove-infl_deriv-borders.hfst $(AM_V_HXFST)$(PRINTF) "read regex \ @\"$<\" \ .o. @\"$(top_builddir)/src/filters/remove-hyphenation-marks.hfst\" \ .o. @\"$(top_builddir)/src/filters/remove-infl_deriv-borders.hfst\" \ ; \n\ invert \n\ save stack $@\n\ quit\n" | $(HFST_XFST) -p $(VERBOSITY) generator%.hfst: analyser%.tmp.hfst $(AM_V_CP)cp -f $< $@ #### Xerox transducer fallback target: #### - inversion is needed in the final step for the GENERATOR. analyser%.xfst: analyser%.tmp.xfst \ $(top_builddir)/src/filters/remove-hyphenation-marks.xfst \ $(top_builddir)/src/filters/remove-infl_deriv-borders.xfst $(AM_V_XFST)$(PRINTF) "read regex \ @\"$<\" \ .o. @\"$(top_builddir)/src/filters/remove-hyphenation-marks.xfst\" \ .o. @\"$(top_builddir)/src/filters/remove-infl_deriv-borders.xfst\" \ ; \n\ save stack $@\n\ quit\n" | $(XFST) $(VERBOSITY) generator%.xfst: analyser%.tmp.xfst $(AM_V_XFST)$(PRINTF) "\ load stack $<\n\ invert net\n\ save stack $@\n\ quit\n" | $(XFST) $(VERBOSITY) #### Foma transducer fallback target: #### - inversion is needed in the final step for the GENERATOR. analyser%.foma: analyser%.tmp.foma $(top_builddir)/src/filters/remove-hyphenation-marks.foma \ $(top_builddir)/src/filters/remove-infl_deriv-borders.foma $(AM_V_XFST)$(PRINTF) "read regex \ @\"$<\" \ .o. @\"$(top_builddir)/src/filters/remove-hyphenation-marks.foma\" \ .o. @\"$(top_builddir)/src/filters/remove-infl_deriv-borders.foma\" \ ; \n\ save stack $@\n\ quit\n" | $(FOMA) $(VERBOSITY) generator%.foma: analyser%.tmp.foma $(AM_V_FOMA)$(PRINTF) "\ load stack $<\n\ invert net\n\ save stack $@\n\ quit\n" | $(FOMA) $(VERBOSITY) ####### Other targets: ########### clean-local: -rm -f *.hfst *.xfst include $(top_srcdir)/am-shared/silent_build-include.am