Skip to content

Commit

Permalink
[Template merge] src/fst reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
flammie committed Jan 21, 2024
1 parent 0d494e5 commit 2090c56
Show file tree
Hide file tree
Showing 86 changed files with 417 additions and 236 deletions.
26 changes: 14 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@
/src/cg3/functions.cg3
/src/cg3/generated-tag-list.cg3
/src/cg3/valency-postspell.cg3
/src/filters/*-tags.txt
/src/filters/*area-*.regex
/src/filters/remove-all*.regex
/src/filters/remove-homonymy-tags.regex
/src/filters/remove-usage-tags.regex
/src/fst/*-error-log.txt
/src/fst/*.tmp.*
/src/fst/filters/*-tags.txt
/src/fst/filters/*area-*.regex
/src/fst/filters/remove-all*.regex
/src/fst/filters/remove-homonymy-tags.regex
/src/fst/filters/remove-usage-tags.regex
/src/fst/morphology/*-error-log.txt
/src/fst/morphology/*.tmp.*
/src/fst/generated_files/*.lexc
/src/fst/lexicon*
/src/fst/url.lexc
/src/orthography/*-nfc2nfd.*
/src/orthography/*-nfd2nfc.*
/src/phonetics/tests/*.sh
/src/fst/morphology/lexicon*
/src/fst/morphology/url.lexc
/src/fst/orthography/*-nfc2nfd.*
/src/fst/orthography/*-nfd2nfc.*
/src/fst/phonetics/tests/*.sh
/test/run-morph-tester.sh
/test/run-yaml-testcases.sh
/test/src/morphology/all*.txt
Expand Down Expand Up @@ -148,3 +148,5 @@ Makefile.in
build
bygg
generated*
.deps
.generated
19 changes: 10 additions & 9 deletions m4/giella-config-files.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ AC_CONFIG_FILES([Makefile \
giella-esu.pc \
manifest.toml \
src/Makefile \
src/filters/Makefile \
src/hyphenation/Makefile \
src/fst/filters/Makefile \
src/fst/syllabification/Makefile \
src/fst/Makefile \
src/orthography/Makefile \
src/phonetics/Makefile \
src/phonetics/tests/Makefile \
src/fst/morphology/Makefile \
src/fst/orthography/Makefile \
src/fst/phonetics/Makefile \
src/fst/phonetics/tests/Makefile \
src/cg3/Makefile \
src/tagsets/Makefile \
src/transcriptions/Makefile \
src/fst/tagsets/Makefile \
src/fst/transcriptions/Makefile \
docs/Makefile \
test/Makefile \
test/tools/Makefile \
Expand Down Expand Up @@ -64,8 +65,8 @@ AC_CONFIG_FILES([Makefile \
# Add one AC_CONFIG_FILES for each script file that needs processing. This gives
# the most pleasant user experience and most readable autoconf code to maintain.
# Spell checker tests, all languages:
AC_CONFIG_FILES([src/phonetics/tests/run_tests.sh],
[chmod a+x src/phonetics/tests/run_tests.sh])
AC_CONFIG_FILES([src/fst/phonetics/tests/run_tests.sh],
[chmod a+x src/fst/phonetics/tests/run_tests.sh])
AC_CONFIG_FILES([test/tools/spellcheckers/test-zhfst-file.sh], \
[chmod a+x test/tools/spellcheckers/test-zhfst-file.sh])
AC_CONFIG_FILES([test/tools/spellcheckers/fstbased/desktop/hfst/test-zhfst-basic-sugg-speed.sh], \
Expand Down
10 changes: 6 additions & 4 deletions m4/giella-macros.m4
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ AC_MSG_RESULT([$GIELLA_CORE])
###############################################################
### This is the version of the Giella Core that we require. ###
### UPDATE AS NEEDED.
_giella_core_min_version=0.20.1
_giella_core_min_version=0.21.0
# GIELLA_CORE/GTCORE env. variable, required by the infrastructure to find scripts:
AC_ARG_VAR([GIELLA_CORE], [directory for the Giella infra core scripts and other required resources])
Expand Down Expand Up @@ -845,9 +845,9 @@ AC_ARG_ENABLE([abbr],
[enable_abbr=$enableval],
[enable_abbr=no])
AS_IF([test x$enable_abbr != xno -a \
"$(find ${srcdir}/src/fst/stems/ -name "abbreviations.lexc" | head -n 1)" = "" ],
"$(find ${srcdir}/src/fst/morphology/stems/ -name "abbreviations.lexc" | head -n 1)" = "" ],
[AC_MSG_ERROR([You asked for abbr.txt generation, but have no file \
src/fst/stems/abbreviations.lexc])])
src/fst/morphoogy/stems/abbreviations.lexc])])
AS_IF([test x$enable_abbr = xyes -a x$enable_generators = xno],
[AC_MSG_ERROR([You need to enable generators to build the abbr file])])
AM_CONDITIONAL([WANT_ABBR], [test "x$enable_abbr" != xno])
Expand Down Expand Up @@ -1002,7 +1002,7 @@ To build, test and install:
make install
EOF
AS_IF([test x$gt_prog_xslt = xno -a \
"$(find ${srcdir}/src/fst/stems -name "*.xml" | head -n 1)" != "" ],
"$(find ${srcdir}/src/fst/morphology/stems -name "*.xml" | head -n 1)" != "" ],
[AC_MSG_WARN([You have XML source files, but XML transformation to LexC is
disabled. Please check the output of configure to locate any problems. The LexC
files will still compile though.
Expand Down Expand Up @@ -1048,5 +1048,7 @@ cd ..
git clone git@github.com:giellalt/$gt_SHARED_FAILS
cd $gt_SHARED_FAILS
./autogen.sh && ./configure && make])])
AC_MSG_WARN([January 2024: the lexc files and fsts have been moved up to src/fst/morphology])
]) # gt_PRINT_FOOTER
# vim: set ft=config:
74 changes: 1 addition & 73 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,7 @@
## Copyright: Sámediggi/Divvun/UiT
## Licence: GPL v3+

# always build . last here, and tagsets have to be built after morphology
SUBDIRS = fst filters phonetics hyphenation orthography cg3 transcriptions tagsets .

####### Automake targets: ########

# Define target variables first, before assigning to them:
GT_ANALYSERS=
GT_GENERATORS=
CUSTOM_FSTS=

#### Local modifications in *fst processing: ####
####
#### Copy the fallback targets, and rename them to the desired targets. Then:
#### Replace the 'cp' command (Xerox) / Prepend the hfst-invert command (Hfst -
#### remember to move the $<) with whatever you need to complete
#### the processing to get the final target transducer.
#### Remember to add the dependencies as well.
#### Also make sure that HFST and Xerox processing are the same.
####
#### If you add new transducers to be built, you need to add them to the
#### relevant variable, e.g.:
####
#### if CAN_HFST
#### GT_GENERATORS+=generator-oahpa-gt-norm.hfst
#### endif
####
#### NB!!!! The HFST targets should get a hyphen after 'analyser'/'generator'
#### respectively, to make the local targets minimally different from and
#### slightly more specific than the fallback targets. This is to avoid warnings
#### about duplicate targets. That is, the local targets should looke like:
####
#### analyser-%.hfst: analyser-%.tmp.hfst
#### generator-%.hfst: generator-%.tmp.hfst

##################################################################
#### BEGIN: Add local processing instructions BELOW this line ####
##################################################################

########################################################
#### Add language-specific transducer targets here: ####

#### Xerox transducers:
if CAN_XFST
GT_ANALYSERS+=
GT_GENERATORS+=

if WANT_CUSTOM_FSTS
CUSTOM_FSTS+=
endif # WANT_CUSTOM_FSTS

endif # CAN_XFST

#### HFST transducers
if CAN_HFST
GT_ANALYSERS+=
GT_GENERATORS+=

if WANT_CUSTOM_FSTS
CUSTOM_FSTS+=
endif # WANT_CUSTOM_FSTS

endif # CAN_HFST

#### FOMA transducers
if CAN_FOMA
GT_ANALYSERS+=
GT_GENERATORS+=

if WANT_CUSTOM_FSTS
CUSTOM_FSTS+=
endif # WANT_CUSTOM_FSTS

endif # CAN_FOMA
SUBDIRS = fst cg3

#################################################
#### Add language-specific build rules here: ####
Expand Down
Loading

0 comments on commit 2090c56

Please sign in to comment.