|
| 1 | +## Process this file with automake to produce Makefile.in |
| 2 | +## Copyright: Sámediggi/Divvun/UiT |
| 3 | +## Licence: GPL v3+ |
| 4 | + |
| 5 | +# always build . last here, and tagsets have to be built after morphology |
| 6 | +SUBDIRS = morphology filters phonetics syllabification orthography transcriptions tagsets . test |
| 7 | + |
| 8 | +####### Automake targets: ######## |
| 9 | + |
| 10 | +# Define target variables first, before assigning to them: |
| 11 | +GT_ANALYSERS= |
| 12 | +GT_GENERATORS= |
| 13 | +CUSTOM_FSTS= |
| 14 | + |
| 15 | +#### Local modifications in *fst processing: #### |
| 16 | +#### |
| 17 | +#### Copy the fallback targets, and rename them to the desired targets. Then: |
| 18 | +#### Replace the 'cp' command (Xerox) / Prepend the hfst-invert command (Hfst - |
| 19 | +#### remember to move the $<) with whatever you need to complete |
| 20 | +#### the processing to get the final target transducer. |
| 21 | +#### Remember to add the dependencies as well. |
| 22 | +#### Also make sure that HFST and Xerox processing are the same. |
| 23 | +#### |
| 24 | +#### If you add new transducers to be built, you need to add them to the |
| 25 | +#### relevant variable, e.g.: |
| 26 | +#### |
| 27 | +#### if CAN_HFST |
| 28 | +#### GT_GENERATORS+=generator-oahpa-gt-norm.hfst |
| 29 | +#### endif |
| 30 | +#### |
| 31 | +#### NB!!!! The HFST targets should get a hyphen after 'analyser'/'generator' |
| 32 | +#### respectively, to make the local targets minimally different from and |
| 33 | +#### slightly more specific than the fallback targets. This is to avoid warnings |
| 34 | +#### about duplicate targets. That is, the local targets should looke like: |
| 35 | +#### |
| 36 | +#### analyser-%.hfst: analyser-%.tmp.hfst |
| 37 | +#### generator-%.hfst: generator-%.tmp.hfst |
| 38 | + |
| 39 | +################################################################## |
| 40 | +#### BEGIN: Add local processing instructions BELOW this line #### |
| 41 | +################################################################## |
| 42 | + |
| 43 | +######################################################## |
| 44 | +#### Add language-specific transducer targets here: #### |
| 45 | + |
| 46 | +#### Xerox transducers: |
| 47 | +if CAN_XFST |
| 48 | +GT_ANALYSERS+= |
| 49 | +GT_GENERATORS+= |
| 50 | + |
| 51 | +if WANT_CUSTOM_FSTS |
| 52 | +CUSTOM_FSTS+= |
| 53 | +endif # WANT_CUSTOM_FSTS |
| 54 | + |
| 55 | +endif # CAN_XFST |
| 56 | + |
| 57 | +#### HFST transducers |
| 58 | +if CAN_HFST |
| 59 | +GT_ANALYSERS+= |
| 60 | +GT_GENERATORS+=generator-dict-gt-norm.hfst |
| 61 | + |
| 62 | +if WANT_CUSTOM_FSTS |
| 63 | +CUSTOM_FSTS+= |
| 64 | +endif # WANT_CUSTOM_FSTS |
| 65 | + |
| 66 | +endif # CAN_HFST |
| 67 | + |
| 68 | +#### FOMA transducers |
| 69 | +if CAN_FOMA |
| 70 | +GT_ANALYSERS+= |
| 71 | +GT_GENERATORS+= |
| 72 | + |
| 73 | +if WANT_CUSTOM_FSTS |
| 74 | +CUSTOM_FSTS+= |
| 75 | +endif # WANT_CUSTOM_FSTS |
| 76 | + |
| 77 | +endif # CAN_FOMA |
| 78 | + |
| 79 | +################################################# |
| 80 | +#### Add language-specific build rules here: #### |
| 81 | + |
| 82 | +# We need to add processing of language-specific tags in the analyser: |
| 83 | +.generated/analyser-gt-desc.%: .genereatd/analyser-gt-desc.tmp.% \ |
| 84 | + filters/remove-derivation-position-tags.% \ |
| 85 | + filters/remove-norm-comp-tags.% \ |
| 86 | + filters/remove-modifier-letter-apostrophe.% \ |
| 87 | + filters/remove-letter-o-with-ogonek-and-macron.% |
| 88 | + $(AM_V_XFST_TOOL)$(PRINTF) "read regex \ |
| 89 | + @\"filters/remove-derivation-position-tags.$*\" \ |
| 90 | + .o. @\"filters/remove-norm-comp-tags.$*\" \ |
| 91 | + .o. @\"$<\" \ |
| 92 | + .o. @\"filters/remove-modifier-letter-apostrophe.$*\" \ |
| 93 | + .o. @\"filters/remove-letter-o-with-ogonek-and-macron.$*\" \ |
| 94 | + ;\n\ |
| 95 | + $(INVERT_HFST)\ |
| 96 | + save stack $@\n\ |
| 97 | + quit\n" | $(XFST_TOOL) |
| 98 | + |
| 99 | +# And also for the normative analyser (foma and hfst): |
| 100 | +.generated/analyser-gt-norm.%: .generated/analyser-gt-norm.tmp.% \ |
| 101 | + filters/remove-illegal-derivation-strings-flagbased.% \ |
| 102 | + filters/insert-default-compounding-tags.% \ |
| 103 | + filters/insert-default_left_compounding-tags.% \ |
| 104 | + filters/block-illegal_compound-strings.% \ |
| 105 | + filters/split-CmpN-tags.% \ |
| 106 | + filters/convert_to_flags-CmpNP-tags.% \ |
| 107 | + filters/split-CmpNP-tags.% \ |
| 108 | + filters/remove-modifier-letter-apostrophe.% \ |
| 109 | + filters/remove-letter-o-with-ogonek-and-macron.% |
| 110 | + $(AM_V_XFST_TOOL)$(PRINTF) "read regex \ |
| 111 | + @\"filters/block-illegal_compound-strings.$*\" \ |
| 112 | + .o. @\"filters/split-CmpN-tags.$*\" \ |
| 113 | + .o. @\"filters/insert-default_left_compounding-tags.$*\" \ |
| 114 | + .o. @\"filters/insert-default-compounding-tags.$*\" \ |
| 115 | + .o. @\"filters/remove-illegal-derivation-strings-flagbased.$*\" \ |
| 116 | + .o. @\"filters/convert_to_flags-CmpNP-tags.$*\" \ |
| 117 | + .o. @\"filters/split-CmpNP-tags.$*\" \ |
| 118 | + .o. @\"$<\" \ |
| 119 | + .o. @\"filters/remove-modifier-letter-apostrophe.$*\" \ |
| 120 | + .o. @\"filters/remove-letter-o-with-ogonek-and-macron.$*\" \ |
| 121 | + ;\n\ |
| 122 | + twosided flag-diacritics\n\ |
| 123 | + $(INVERT_HFST)\ |
| 124 | + save stack $@\n\ |
| 125 | + quit\n" | $(XFST_TOOL) |
| 126 | + |
| 127 | +# The operation 'twosided flag-diacritics" crashes Xerox badly, so we do with |
| 128 | +# a simpler, less restrictive normative fst when building with Xerox: |
| 129 | +.generated/analyser-gt-norm.xfst: .generated/analyser-gt-norm.tmp.xfst \ |
| 130 | + filters/remove-norm-comp-tags.xfst \ |
| 131 | + filters/remove-derivation-position-tags.xfst \ |
| 132 | + filters/remove-illegal-derivation-strings.xfst \ |
| 133 | + filters/remove-modifier-letter-apostrophe.xfst \ |
| 134 | + filters/remove-letter-o-with-ogonek-and-macron.xfst |
| 135 | + $(AM_V_XFST)$(PRINTF) "read regex \ |
| 136 | + @\"filters/remove-norm-comp-tags.xfst\" \ |
| 137 | + .o. @\"filters/remove-derivation-position-tags.xfst\" \ |
| 138 | + .o. @\"filters/remove-illegal-derivation-strings.xfst\" \ |
| 139 | + .o. @\"$<\" \ |
| 140 | + .o. @\"filters/remove-modifier-letter-apostrophe.xfst\" \ |
| 141 | + .o. @\"filters/remove-letter-o-with-ogonek-and-macron.xfst\" \ |
| 142 | + ;\n\ |
| 143 | + save stack $@\n\ |
| 144 | + quit\n" | $(XFST) $(VERBOSITY) |
| 145 | + |
| 146 | +# Special case for the disamb analyser, since it follows the same filename |
| 147 | +# pattern as the raw fst: |
| 148 | +.generated/analyser-disamb-gt-desc.%: .generated/analyser-disamb-gt-desc.tmp.% \ |
| 149 | + filters/remove-derivation-position-tags.% \ |
| 150 | + filters/remove-norm-comp-tags.% \ |
| 151 | + filters/remove-modifier-letter-apostrophe.% \ |
| 152 | + filters/remove-letter-o-with-ogonek-and-macron.% |
| 153 | + $(AM_V_XFST)$(PRINTF) "read regex \ |
| 154 | + @\"filters/remove-derivation-position-tags.$*\" \ |
| 155 | + .o. @\"filters/remove-norm-comp-tags.$*\" \ |
| 156 | + .o. @\"$<\" \ |
| 157 | + .o. @\"filters/remove-modifier-letter-apostrophe.$*\" \ |
| 158 | + .o. @\"filters/remove-letter-o-with-ogonek-and-macron.$*\" \ |
| 159 | + ;\n\ |
| 160 | + $(INVERT_HFST)\ |
| 161 | + save stack $@\n\ |
| 162 | + quit\n" | $(XFST_TOOL) |
| 163 | + |
| 164 | +# We need to add processing of language-specific tags in the generator: |
| 165 | +define giella_generators |
| 166 | +.generated/generator-gt-%.$(1): .generated/generator-gt-%.tmp.$(1) \ |
| 167 | + filters/remove-derivation-position-tags.$(1) \ |
| 168 | + filters/remove-norm-comp-tags.$(1) \ |
| 169 | + filters/remove-modifier-letter-apostrophe.$(1) \ |
| 170 | + filters/remove-o-with-ogonek-and-macron.$(1) |
| 171 | + $$(AM_V_XFST_TOOL)$$(PRINTF) "read regex \ |
| 172 | + @\"filters/remove-derivation-position-tags.$(1)\" \ |
| 173 | + .o. @\"filters/remove-norm-comp-tags.$(1)\" \ |
| 174 | + .o. @\"$$<\" \ |
| 175 | + .o. @\"filters/remove-o-with-ogonek-and-macron.$(1)\" \ |
| 176 | + .o. @\"filters/remove-modifier-letter-apostrophe.$(1)\" \ |
| 177 | + ;\n\ |
| 178 | + $$(INVERT_XFST)$$(INVERT_FOMA)\ |
| 179 | + save stack $$@\n\ |
| 180 | + quit\n" | $$(XFST_TOOL) |
| 181 | +endef |
| 182 | +$(foreach fst,hfst xfst foma,$(eval $(call giella_generators,$(fst)))) |
| 183 | + |
| 184 | +# Do NOT apply the accent removal filters to the normative |
| 185 | +# dictionary generator (both hfst and xfst): |
| 186 | +.generatd/generator-dict-gt-norm.%: .generated/generator-dict-gt-norm.tmp.% \ |
| 187 | + filters/remove-derivation-position-tags.% \ |
| 188 | + filters/remove-norm-comp-tags.% |
| 189 | + $(AM_V_XFST_TOOL)$(PRINTF) "read regex \ |
| 190 | + @\"filters/remove-derivation-position-tags.$*\" \ |
| 191 | + .o. @\"filters/remove-norm-comp-tags.$*\" \ |
| 192 | + .o. @\"$<\" \ |
| 193 | + ;\n\ |
| 194 | + $(INVERT_XFST)$(INVERT_FOMA)\ |
| 195 | + save stack $@\n\ |
| 196 | + quit\n" | $(XFST_TOOL) |
| 197 | + |
| 198 | + |
| 199 | +################################################################## |
| 200 | +#### END: Add local processing instructions ABOVE this line ###### |
| 201 | +################################################################## |
| 202 | + |
| 203 | +include $(top_srcdir)/../giella-core/am-shared/src-fst-dir-include.am |
0 commit comments