## 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 .hfstol,$(DIGIT2TXT)) GT_TRANSCRIPTORS+=$(addsuffix .hfstol,$(TXT2DIGIT)) endif # CAN_HFST if CAN_XFST GT_TRANSCRIPTORS+=$(addsuffix .xfst,$(DIGIT2TXT)) GT_TRANSCRIPTORS+=$(addsuffix .xfst,$(TXT2DIGIT)) endif # CAN_XFST if CAN_FOMA GT_TRANSCRIPTORS+=$(addsuffix .foma,$(DIGIT2TXT)) GT_TRANSCRIPTORS+=$(addsuffix .foma,$(TXT2DIGIT)) endif # CAN_FOMA endif # WANT_TRANSCRIPTORS noinst_DATA=$(GT_TRANSCRIPTORS) # The number-clock-date2text & inverse conversion transducers: # The digit-to-text transducers are built here: define digit2txt_transcriptors transcriptor-%-digit2text.filtered.$(1): \ transcriptor-%-digit2text.$(1) \ ../filters/remove-NA-strings.$(1) \ ../filters/remove-NG-strings.$(1) \ ../filters/remove-usage-tags.$(1) $$(AM_V_XFST_TOOL)$$(PRINTF) "read regex \ @\"../filters/remove-usage-tags.$(1)\" \ .o. @\"../filters/remove-NA-strings.$(1)\" \ .o. @\"../filters/remove-NG-strings.$(1)\" \ .o. @\"$$<\" \ .o. @\"../filters/remove-NG-strings.$(1)\".i \ .o. @\"../filters/remove-usage-tags.$(1)\".i \ ;\n\ save stack $$@\n\ quit\n" | $$(XFST_TOOL) endef $(foreach fst,hfst xfst foma,$(eval $(call digit2txt_transcriptors,$(fst)))) # The text-to-digit transducers are built here: define txt2digit_transcriptors transcriptor-%-text2digit.filtered.$(1): \ transcriptor-%-digit2text.$(1) \ ../filters/remove-usage-tags.$(1) \ ../orthography/spellrelax-tags.compose.$(1) \ ../orthography/spellrelax-with-tags.compose.$(1) $$(AM_V_XFST_TOOL)$$(PRINTF) "define Lex \ [ @\"../filters/remove-usage-tags.$(1)\" \ .o. @\"$$<\" \ .o. @\"../filters/remove-usage-tags.$(1)\".i \ ] @\"../orthography/spellrelax-tags.compose.$(1)\" ;\n\ define spellrelax @\"../orthography/spellrelax-with-tags.compose.$(1)\" ;\n\ read regex Lex .o. spellrelax ;\n\ invert net\n\ save stack $$@\n\ quit\n" | $$(XFST_TOOL) endef $(foreach fst,hfst xfst foma,$(eval $(call txt2digit_transcriptors,$(fst)))) ####### Other targets: ########### clean-local: -rm -f *.hfstol *.xfst *.foma *.hfst include $(top_srcdir)/am-shared/lexc-include.am include $(top_srcdir)/am-shared/lookup-include.am include $(top_srcdir)/am-shared/xfscript-include.am include $(top_srcdir)/am-shared/hfst-format-include.am include $(top_srcdir)/am-shared/silent_build-include.am # vim: set ft=automake: