## Include this file to lexc directory to build lexical automata ## 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 . ####### Source file defs: ######## #! @param GT_TRANSCRIPTIONS_SRCS required, the source files for orthographic #! transcriptions. EXTRA_DIST=$(GT_TRANSCRIPTIONS_SRCS) ####### Automake targets: ######## # The transducers we build and don't distribute depend on the configuration: GT_TRANSCRIPTORS= if WANT_TRANSCRIPTORS # Replace .lexc with .filtered.lookup: DIGIT2TXT=$(patsubst %.lexc,%.filtered.lookup,$(GT_TRANSCRIPTIONS_SRCS)) # Replace digit2text with text2digit to get the inverse fst's: TXT2DIGIT=$(subst digit2text,text2digit,$(DIGIT2TXT)) # Add the proper suffix for each compiler: if CAN_HFST GT_TRANSCRIPTORS+=$(addsuffix .hfst,$(DIGIT2TXT)) GT_TRANSCRIPTORS+=$(addsuffix .hfst,$(TXT2DIGIT)) endif # CAN_HFST if CAN_XFST GT_TRANSCRIPTORS+=$(addsuffix .xfst,$(DIGIT2TXT)) GT_TRANSCRIPTORS+=$(addsuffix .xfst,$(TXT2DIGIT)) endif # CAN_XFST endif # WANT_TRANSCRIPTORS noinst_DATA=$(GT_TRANSCRIPTORS) # The number-clock-date2text & inverse conversion transducers: transcriptor-%-digit2text.filtered.hfst: \ transcriptor-%-digit2text.hfst \ ../filters/remove-NA-strings.hfst \ ../filters/remove-NG-strings.hfst \ ../filters/remove-usage-tags.hfst $(AM_V_RGX2FST)$(PRINTF) "\ @\"../filters/remove-usage-tags.hfst\" \ .o. @\"../filters/remove-NA-strings.hfst\" \ .o. @\"../filters/remove-NG-strings.hfst\" \ .o. @\"$<\" \ .o. @\"../filters/remove-NG-strings.hfst\" \ .o. @\"../filters/remove-usage-tags.hfst\".i \ ;" \ | $(HFST_REGEXP2FST) $(HFST_FLAGS) -S --xerox-composition=ON \ > $@ transcriptor-%-digit2text.filtered.xfst: \ transcriptor-%-digit2text.xfst \ ../filters/remove-NA-strings.xfst \ ../filters/remove-NG-strings.xfst \ ../filters/remove-usage-tags.xfst $(AM_V_XFST)$(PRINTF) "read regex \ @\"../filters/remove-usage-tags.xfst\" \ .o. @\"../filters/remove-NA-strings.xfst\" \ .o. @\"../filters/remove-NG-strings.xfst\" \ .o. @\"$<\" \ .o. @\"../filters/remove-NG-strings.xfst\" \ .o. @\"../filters/remove-usage-tags.xfst\".i \ ;\n\ save stack $@\n\ quit\n" | $(XFST) $(VERBOSITY) # The text-to-digit transducers are built here: transcriptor-%-text2digit.filtered.hfst: \ transcriptor-%-digit2text.hfst \ ../filters/remove-usage-tags.hfst \ ../orthography/spellrelax.compose.hfst $(AM_V_RGX2FST)$(PRINTF) "\ @\"../filters/remove-usage-tags.hfst\" \ .o. @\"$<\" \ .o. @\"../filters/remove-usage-tags.hfst\".i \ .o. @\"../orthography/spellrelax.compose.hfst\" \ ;" \ | $(HFST_REGEXP2FST) $(HFST_FLAGS) -S --xerox-composition=ON \ | $(HFST_INVERT) $(HFST_FLAGS) \ > $@ transcriptor-%-text2digit.filtered.xfst: \ transcriptor-%-digit2text.xfst \ ../filters/remove-usage-tags.xfst \ ../orthography/spellrelax.compose.xfst $(AM_V_XFST)$(PRINTF) "read regex \ @\"../filters/remove-usage-tags.xfst\" \ .o. @\"$<\" \ .o. @\"../filters/remove-usage-tags.xfst\".i \ .o. @\"../orthography/spellrelax.compose.xfst\" \ ;\n\ invert net\n\ save stack $@\n\ quit\n" | $(XFST) $(VERBOSITY) ####### Other targets: ########### clean-local: -rm -f *.hfst *.xfst include $(top_srcdir)/am-shared/lexc-include.am include $(top_srcdir)/am-shared/lookup-include.am include $(top_srcdir)/am-shared/silent_build-include.am # vim: set ft=automake: