## 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 . # Included build file to build transducers for list-based spellers, ie spellers # that either *is* a list (e.g. hunspell) or needs a generated list before # further processing (Polderland/PLX spellers). The fst's produced here are # common to both speller types, and further processing is done in separate # subdirs & build files. # Hfst fst variables: GT_SPELLER_SRC_HFST=../generator-speller-gt-norm.hfst GT_COMMON_LISTSPELLER_HFST= # Xerox fst variables - Xerox can be used for building the list-based spellers: GT_SPELLER_SRC_XFST=../analyser-speller-gt-norm.xfst GT_COMMON_LISTSPELLER_XFST= ####### Automake targets: ######## if WANT_HUNSPELL if CAN_HFST GT_COMMON_LISTSPELLER_HFST+=generator-listspeller-gt-norm.hfst endif # CAN_HFST if CAN_XFST GT_COMMON_LISTSPELLER_XFST+=analyser-listspeller-gt-norm.xfst endif # CAN_XFST endif # WANT_HUNSPELL noinst_DATA=$(GT_COMMON_LISTSPELLER_HFST) $(GT_COMMON_LISTSPELLER_XFST) ####### Build rules: ######## # Build the fst used for the list-based spellers # # Also: hyphens at the end of +Cmp/SplitR words are removed for easier processing # later in the PLX conversion. The word forms in question can still be # identified using the +Cmp/SplitR tag. generator-listspeller-gt-norm.tmp.hfst: $(GT_SPELLER_SRC_HFST) \ $(top_builddir)/src/filters/remove-UseCirc-strings.hfst \ $(top_builddir)/src/hyphenation/hyphenation.compose.hfst $(AM_V_HXFST)$(PRINTF) "set xerox-composition ON \n\ read regex \ @\"$(top_builddir)/src/filters/remove-UseCirc-strings.hfst\" \ .o. @\"$<\" \ ; \n\ set flag-is-epsilon ON \n\ read regex @\"$(top_builddir)/src/hyphenation/hyphenation.compose.hfst\" ; \n\ turn stack \n\ compose net \n\ define fst \n\ load stack filters/extract-RCmpnd-strings.hfst \n\ define rcmpnd \n\ read regex rcmpnd .o. fst ; \n\ define cmps \n\ read regex cmps .o. [%%- -> 0 || _ .#.] ; \n\ read regex fst - cmps ; \n\ union net \n\ save stack $@ \n\ quit\n" | $(HFST_XFST) $(VERBOSITY) analyser-listspeller-gt-norm.tmp.xfst: $(GT_SPELLER_SRC_XFST) \ $(top_builddir)/src/filters/remove-UseCirc-strings.xfst \ $(top_builddir)/src/hyphenation/hyphenation.compose.xfst $(AM_V_XFST)$(PRINTF) "read regex \ @\"$(top_builddir)/src/filters/remove-UseCirc-strings.xfst\" \ .o. @\"$<\" \ ; \n\ set flag-is-epsilon ON \n\ read regex @\"$(top_builddir)/src/hyphenation/hyphenation.compose.xfst\" ; \n\ turn stack \n\ compose net \n\ define fst \n\ load stack filters/extract-RCmpnd-strings.xfst \n\ define rcmpnd \n\ read regex rcmpnd .o. fst ; \n\ define cmps \n\ read regex cmps .o. [%%- -> 0 || _ .#.] ; \n\ read regex fst - cmps ; \n\ union net \n\ save stack $@ \n\ quit\n" | $(XFST) $(VERBOSITY) #### Xerox transducer fallback target: %.hfst: %.tmp.hfst $(AM_V_CP)cp -f $< $@ #### Xerox transducer fallback target: %.xfst: %.tmp.xfst $(AM_V_CP)cp -f $< $@ ####### Other targets: ########### clean-local: -rm -f *.hfst *.xfst include $(top_srcdir)/am-shared/silent_build-include.am # vim: set ft=automake: