Skip to content

Commit 6f9ff37

Browse files
committed
[Template merge] devtest targets
1 parent c492321 commit 6f9ff37

File tree

54 files changed

+518
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+518
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
*.zhfst
2222
*.zip
2323
*.zpipe
24+
*.py.log
25+
*.py.trs
2426
*.sh.log
2527
*.sh.trs
28+
*.yaml.log
29+
*.yaml.trs
2630
.DS_Store
2731
.bundle
2832
.~lock.*#
@@ -79,6 +83,7 @@
7983
/src/fst/phonetics/tests/tests/*.sh
8084
/test/run-morph-tester.sh
8185
/test/run-yaml-testcases.sh
86+
/src/fst/morphology/test/*-adjective.txt
8287
/src/fst/morphology/test/all*.txt
8388
/src/fst/morphology/test/analysed*.txt
8489
/src/fst/morphology/test/filtered*

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ dev:
2929
# Remove html tables created by some of the developer tools:
3030
clean-local:
3131
rm -f *.html
32+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

docs/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
# The generated docs are automatically detected by the automake script
66

77
include $(top_srcdir)/../giella-core/am-shared/docs-dir-include.am
8+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ SUBDIRS = fst cg3
1212
##################################################################
1313

1414
include $(top_srcdir)/../giella-core/am-shared/src-dir-include.am
15+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

src/cg3/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ clean-local:
3939
####### Build rules via include: ########
4040

4141
include $(top_srcdir)/../giella-core/am-shared/src-syntax-dir-include.am
42+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

src/cg3/test/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
# List tests that are presently (expected) failures here, ie things that should
99
# be fixed *later*, but is not critical at the moment:
1010
# XFAIL_TESTS=
11+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

src/fst/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,4 @@ $(foreach fst,hfst xfst foma,$(eval $(call giella_generators,$(fst))))
201201
##################################################################
202202

203203
include $(top_srcdir)/../giella-core/am-shared/src-fst-dir-include.am
204+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

src/fst/Makefile.am.orig

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
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

src/fst/filters/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ EXTRA_SRCS=
6565
include $(top_srcdir)/../giella-core/am-shared/src-filters-dir-include.am
6666

6767
# vim: set ft=automake:
68+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

src/fst/filters/Makefile.am.orig

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
## Process this file with automake to produce Makefile.in
2+
3+
## Copyright (C) 2011 Samediggi
4+
5+
## This program is free software: you can redistribute it and/or modify
6+
## it under the terms of the GNU General Public License as published by
7+
## the Free Software Foundation, either version 3 of the License, or
8+
## (at your option) any later version.
9+
10+
## This program is distributed in the hope that it will be useful,
11+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
## GNU General Public License for more details.
14+
15+
## You should have received a copy of the GNU General Public License
16+
## along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
#########################################################
19+
############## BEGIN: Local modifications ###############
20+
21+
# List any local filter regex files here:
22+
GIELLA_FILTER_LOCAL_REGEX_SRCS=\
23+
downcase_UCletters.regex \
24+
remove-norm-comp-tags.regex \
25+
remove-DNorm-tags.regex \
26+
remove-modifier-letter-apostrophe.regex \
27+
remove-letter-o-with-ogonek-and-macron.regex \
28+
block-illegal_compound-strings.regex \
29+
insert-default-compounding-tags.regex \
30+
insert-default_left_compounding-tags.regex \
31+
remove-derivation-position-tags.regex \
32+
remove-illegal-derivation-strings.regex \
33+
remove-illegal-derivation-strings-flagbased.regex \
34+
rename-POS_before_Der-tags.regex \
35+
split-CmpN-tags.regex \
36+
split-CmpNP-tags.regex \
37+
convert_to_flags-CmpNP-tags.regex
38+
39+
# List any local filter xfscript files here:
40+
GIELLA_FILTER_LOCAL_XFSCRIPT_SRCS=
41+
42+
# List any local filter lexc files here:
43+
GIELLA_FILTER_LOCAL_LEXC_SRCS=
44+
45+
# List any locally generated regex source files here:
46+
GIELLA_FILTER_LOCAL_GENERATED_REGEX_SRCS=
47+
48+
# List any locally generated xfscript source files here:
49+
GIELLA_FILTER_LOCAL_GENERATED_XFSCRIPT_SRCS=
50+
51+
# List any locally generated lexc source files here:
52+
GIELLA_FILTER_LOCAL_GENERATED_LEXC_SRCS=
53+
54+
# List any additional source files here, so that they are included in the dist.
55+
# Source files that are not directly compiled to fst's but are instead used as
56+
# part of a local build step should be listed here.
57+
EXTRA_SRCS=
58+
59+
########## Add local build rules below here: ############
60+
61+
############### END: Local modifications ################
62+
#########################################################
63+
64+
# Included build file, where the actual build instructions are:
65+
include $(top_srcdir)/../giella-core/am-shared/src-filters-dir-include.am
66+
67+
# vim: set ft=automake:

src/fst/morphology/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,4 @@ include $(srcdir)/Makefile.modifications-phon.am
149149
include $(top_srcdir)/../giella-core/am-shared/src-morphology-dir-include.am
150150

151151
# vim: set ft=automake:
152+
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am

0 commit comments

Comments
 (0)