Skip to content

Commit

Permalink
Merge branch 'main' of github.com:giellalt/lang-fit
Browse files Browse the repository at this point in the history
  • Loading branch information
linalejdebro committed Jun 12, 2024
2 parents c760953 + 88dc8a6 commit a92f2ad
Show file tree
Hide file tree
Showing 26 changed files with 496 additions and 125 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,9 @@
/test/run-morph-tester.sh
/test/run-yaml-testcases.sh
/src/fst/morphology/test/*-adjective.txt
/src/fst/morphology/test/all*.txt
/src/fst/morphology/test/analysed*.txt
/src/fst/morphology/test/*.txt
/src/fst/morphology/test/filtered*
/src/fst/morphology/test/generate-*-lemmas.sh
/src/fst/morphology/test/generated*.txt
/src/fst/morphology/test/missing_*.txt
/src/fst/morphology/test/phonology/negative-*.txt
/src/fst/morphology/test/phonology/hfst-twolc-error-messages.txt
/src/fst/morphology/test/phonology/pair-*.txt
Expand Down
4 changes: 2 additions & 2 deletions .gut/delta.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
template = "https://github.com/giellalt/template-lang-und"
rev_id = 181
template_sha = "14364def61fe46ccab58563a081ee5818da5b592"
rev_id = 183
template_sha = "d0a0bae6ad6b62a4cd75ab409a3666d7362152b1"

[replacements]
__REPO__ = "lang-fit"
Expand Down
22 changes: 21 additions & 1 deletion 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.23.0
_giella_core_min_version=1.0.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 @@ -674,6 +674,23 @@ AS_IF([test "x$enable_grammarchecker" != "xno"],
then: pipx install git+https://github.com/divvun/giellaltgramtools
])]),
AC_MSG_RESULT(yes))
_gtgramtool_min_version=0.7.0
gtgramtool_too_old_message="gtgramtool needs to be updated.
If you installed it with pipx, run:
pipx upgrade GiellaLTGramTools"
AC_MSG_CHECKING([the version of gtgramtool])
AS_IF([test "x${GTGRAMTOOL}" != xno],
[_gtgramtool_version=$( "${GTGRAMTOOL}" --version | sed -e 's/^.*version //')],
[_gtgramtool_version=0])
AC_MSG_RESULT([$_gtgramtool_version])
AS_IF([test "x$enable_grammarchecker" != "xno"],
AC_MSG_CHECKING([whether the gtgramtool version is at least $_gtgramtool_min_version])
AX_COMPARE_VERSION([$_gtgramtool_version], [ge], [$_gtgramtool_min_version],
[gtgramtool_version_ok=yes], [gtgramtool_version_ok=no])
AS_IF([test "x${gtgramtool_version_ok}" != xno],
[AC_MSG_RESULT([$gtgramtool_version_ok])],
[AC_MSG_ERROR([$gtgramtool_too_old_message])]))
# Enable all spellers - default is 'no'
AC_ARG_ENABLE([spellers],
Expand Down Expand Up @@ -998,6 +1015,9 @@ To build, test and install:
make
make check
make install
The developers’ version of the test suite is available under:
make devtest
this version does not halt on errors and should be useful when fixing bugs
EOF
AS_IF([test x$gt_prog_xslt = xno -a \
"$(find ${srcdir}/src/fst/morphology/stems -name "*.xml" | head -n 1)" != "" ],
Expand Down
4 changes: 2 additions & 2 deletions src/fst/morphology/test/tag_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ fi

# Extract USED tags:
sed -e '1,/LEXICON Root/d' < \
../../../src/fst/lexicon.tmp.lexc | # Extract all lines after LEXICON Root
../lexicon.lexc | # Extract all lines after LEXICON Root
${giella_core}/scripts/extract-used-tags.sh | # Extract tags, local mods after this line:
LC_ALL=no_NO.UTF8 sort -u \
> "${lexctags}"

# Extract DEFINED tags:
sed -n '/LEXICON Root/q;p' \
../../../src/fst/lexicon.tmp.lexc | # Extract all lines before LEXICON Root
../lexicon.lexc | # Extract all lines before LEXICON Root
${giella_core}/scripts/extract-defined-tags.sh | # Extract tags, local mods after this line:
LC_ALL=no_NO.UTF8 sort -u \
> "${roottags}"
Expand Down
20 changes: 5 additions & 15 deletions src/fst/orthography/test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,28 @@
## Copyright: Sámediggi/Divvun/UiT
## Licence: GPL v3+

######## Test targets: ###########
######## Local test targets: ###########

# List here (space separated) all test scripts that should be run
# _unconditionally_:
TESTS=

# Yaml tests are run from shell scripts - specify them here:
YAML_TEST_RUNNERS=run-initcaps-genyaml-testcases.sh
# Add local yaml tests here
YAML_TEST_RUNNERS=
# Specify other shell scripts here to make sure they are included in the distro
# even though spellers are disabled:
OTHER_TEST_RUNNERS=

if CAN_YAML_TEST
# Add your shell scripts for running python-based tests below here, so that
# they are only run if the preconditions for yaml tests are met.
TESTS+=$(YAML_TEST_RUNNERS)
TESTS+=
endif # CAN_YAML_TEST

# List tests that are presently (expected) failures here, ie things that should
# be fixed *later*, but is not critical at the moment:
XFAIL_TESTS=

# Make sure all required files are included in the distribution:
YAML_FILES=$(wildcard *.yaml)
YAML_DIRS=

EXTRA_DIST=$(OTHER_TEST_RUNNERS) \
$(YAML_TEST_RUNNERS) \
$(YAML_FILES) \
$(YAML_DIRS)

####### Other targets: ###########
clean-local:
-rm -f *.txt
include $(top_srcdir)/../giella-core/am-shared/src-fst-orthography-test-include.am
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am
33 changes: 29 additions & 4 deletions src/fst/orthography/test/run-initcaps-genyaml-testcases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
# specified transducer. This determines also the set of yaml test files looped
# over by the test runner.

# ensure that we are ran from make or setup properly
if test -z "$srcdir" ; then
echo "srcdir= not set, this must be run from make or set srcdir=."
exit 2
fi
if test -z "$GIELLA_CORE" ; then
echo "GIELLA_CORE= must point to giella-core"
exit 2
fi
if test -z "$TESTKITS" ; then
TESTKITS=hfst
fi
relpath="$GIELLA_CORE/scripts/"
testrunner="$relpath/run-yaml-testcases.sh"
if ! test -x "$testrunner" ; then
echo "missing test runner in $testrunner"
exit 77
fi

###### User variables - adjust as needed: #######
# Specify the invariable part of the transducer name:
transducer=inituppercase
Expand All @@ -19,7 +38,13 @@ halftest=gen
# same dir as this script:
yaml_file_subdir=.

####### Include/source helper script from dir above - DO NOT CHANGE: ########
# Relative path from test script to test runner:
testrunner="../../../../test/run-yaml-testcases.sh"
source $testrunner $transducer $yaml_file_subdir ../../../../test/ $halftest
####### Run the helper script from giella core - DO NOT CHANGE: ########
for tk in $TESTKITS ; do
"$testrunner" $transducer "$yaml_file_subdir" "$tk" "$relpath" "$srcdir" "$halftest"
rv=$?
if test $rv == 77 ; then
exit 77
elif test $rv -gt 0 ; then
exit 1
fi
done
22 changes: 14 additions & 8 deletions src/fst/test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
## Copyright: Sámediggi/Divvun/UiT
## Licence: GPL v3+

######## Test targets: ###########
######## Local test targets: ###########

# List here (space separated) all test scripts that should be run
# _unconditionally_:
# Add local tests here that will be run always
TESTS=

# Add local yaml testers here:
YAML_TEST_RUNNERS=

# Add other local tests here:
OTHER_TEST_RUNNERS=

if CAN_YAML_TEST
# Add your shell scripts for running python-based tests below here, so that
# they are only run if the preconditions for yaml tests are met.
Expand All @@ -16,12 +21,11 @@ if CAN_YAML_TEST
if WANT_MORPHOLOGY
TESTS+=run-gt-norm-anayaml-testcases.sh \
run-gt-desc-anayaml-testcases.sh

# This is for yaml tests requiring BOTH an analyser AND a generator:
if WANT_GENERATION
TESTS+=run-gt-norm-yaml-testcases.sh \
run-gt-desc-yaml-testcases.sh \
run-lexc-testcases.sh
run-gt-desc-yaml-testcases.sh

endif # WANT_GENERATION
endif # WANT_MORPHOLOGY

Expand Down Expand Up @@ -50,7 +54,9 @@ XFAIL_TESTS=run-dict-gt-desc-anayaml-testcases.sh \
run-gt-norm-genyaml-testcases.sh \
run-lexc-testcases.sh



####### Other targets: ###########
clean-local:
-rm -f *.txt

include $(top_srcdir)/../giella-core/am-shared/src-fst-test-include.am
include $(top_srcdir)/../giella-core/am-shared/devtest-include.am
34 changes: 30 additions & 4 deletions src/fst/test/run-dict-gt-desc-anayaml-testcases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@
# specified transducer. This determines also the set of yaml test files looped
# over by the test runner.


# ensure that we are ran from make or setup properly
if test -z "$srcdir" ; then
echo "srcdir= not set, this must be run from make or set srcdir=."
exit 2
fi
if test -z "$GIELLA_CORE" ; then
echo "GIELLA_CORE= must point to giella-core"
exit 2
fi
if test -z "$TESTKITS" ; then
TESTKITS=hfst
fi
relpath="$GIELLA_CORE/scripts/"
testrunner="$relpath/run-yaml-testcases.sh"
if ! test -x "$testrunner" ; then
echo "missing test runner in $testrunner"
exit 77
fi

###### User variables - adjust as needed: #######
# Specify the invariable part of the transducer name:
transducer=dict-gt-desc
Expand All @@ -18,7 +38,13 @@ halftest=ana
# same dir as this script:
yaml_file_subdir=dict-gt-yamls

####### Include/source helper script from dir above - DO NOT CHANGE: ########
# Relative path from test script to test runner:
testrunner="../../../test/run-yaml-testcases.sh"
source $testrunner $transducer $yaml_file_subdir ../../../test $halftest
####### Run the helper script from giella core - DO NOT CHANGE: ########
for tk in $TESTKITS ; do
"$testrunner" $transducer "$yaml_file_subdir" "$tk" "$relpath" "$srcdir" "$halftest"
rv=$?
if test $rv == 77 ; then
exit 77
elif test $rv -gt 0 ; then
exit 1
fi
done
33 changes: 29 additions & 4 deletions src/fst/test/run-dict-gt-norm-genyaml-testcases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
# specified transducer. This determines also the set of yaml test files looped
# over by the test runner.

# ensure that we are ran from make or setup properly
if test -z "$srcdir" ; then
echo "srcdir= not set, this must be run from make or set srcdir=."
exit 2
fi
if test -z "$GIELLA_CORE" ; then
echo "GIELLA_CORE= must point to giella-core"
exit 2
fi
if test -z "$TESTKITS" ; then
TESTKITS=hfst
fi
relpath="$GIELLA_CORE/scripts/"
testrunner="$relpath/run-yaml-testcases.sh"
if ! test -x "$testrunner" ; then
echo "missing test runner in $testrunner"
exit 77
fi

###### User variables - adjust as needed: #######
# Specify the invariable part of the transducer name:
transducer=dict-gt-norm
Expand All @@ -18,7 +37,13 @@ halftest=gen
# same dir as this script:
yaml_file_subdir=dict-gt-yamls

####### Include/source helper script from dir above - DO NOT CHANGE: ########
# Relative path from test script to test runner:
testrunner="../../../test/run-yaml-testcases.sh"
source $testrunner $transducer $yaml_file_subdir ../../../test/ $halftest
####### Run the helper script from giella core - DO NOT CHANGE: ########
for tk in $TESTKITS ; do
"$testrunner" $transducer "$yaml_file_subdir" "$tk" "$relpath" "$srcdir" "$halftest"
rv=$?
if test $rv == 77 ; then
exit 77
elif test $rv -gt 0 ; then
exit 1
fi
done
33 changes: 29 additions & 4 deletions src/fst/test/run-gt-desc-anayaml-testcases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
# specified transducer. This determines also the set of yaml test files looped
# over by the test runner.

# ensure that we are ran from make or setup properly
if test -z "$srcdir" ; then
echo "srcdir= not set, this must be run from make or set srcdir=."
exit 2
fi
if test -z "$GIELLA_CORE" ; then
echo "GIELLA_CORE= must point to giella-core"
exit 2
fi
if test -z "$TESTKITS" ; then
TESTKITS=hfst
fi
relpath="$GIELLA_CORE/scripts/"
testrunner="$relpath/run-yaml-testcases.sh"
if ! test -x "$testrunner" ; then
echo "missing test runner in $testrunner"
exit 77
fi

###### User variables - adjust as needed: #######
# Specify the invariable part of the transducer name:
transducer=gt-desc
Expand All @@ -18,7 +37,13 @@ halftest=ana
# same dir as this script:
yaml_file_subdir=gt-desc-yamls

####### Include/source helper script from dir above - DO NOT CHANGE: ########
# Relative path from test script to test runner:
testrunner="../../../test/run-yaml-testcases.sh"
source $testrunner $transducer $yaml_file_subdir ../../../test $halftest
####### Run the test script from giella-core - DO NOT CHANGE: ########
for tk in $TESTKITS ; do
"$testrunner" $transducer "$yaml_file_subdir" "$tk" "$relpath" "$srcdir" "$halftest"
rv=$?
if test $rv == 77 ; then
exit 77
elif test $rv -gt 0 ; then
exit 1
fi
done
33 changes: 29 additions & 4 deletions src/fst/test/run-gt-desc-genyaml-testcases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
# specified transducer. This determines also the set of yaml test files looped
# over by the test runner.

# ensure that we are ran from make or setup properly
if test -z "$srcdir" ; then
echo "srcdir= not set, this must be run from make or set srcdir=."
exit 2
fi
if test -z "$GIELLA_CORE" ; then
echo "GIELLA_CORE= must point to giella-core"
exit 2
fi
if test -z "$TESTKITS" ; then
TESTKITS=hfst
fi
relpath="$GIELLA_CORE/scripts/"
testrunner="$relpath/run-yaml-testcases.sh"
if ! test -x "$testrunner" ; then
echo "missing test runner in $testrunner"
exit 77
fi

###### User variables - adjust as needed: #######
# Specify the invariable part of the transducer name:
transducer=gt-desc
Expand All @@ -18,7 +37,13 @@ halftest=gen
# same dir as this script:
yaml_file_subdir=gt-desc-yamls

####### Include/source helper script from dir above - DO NOT CHANGE: ########
# Relative path from test script to test runner:
testrunner="../../../test/run-yaml-testcases.sh"
source $testrunner $transducer $yaml_file_subdir ../../../test $halftest
####### Run the test script from giella-core - DO NOT CHANGE: ########
for tk in $TESTKITS ; do
"$testrunner" $transducer "$yaml_file_subdir" "$tk" "$relpath" "$srcdir" "$halftest"
rv=$?
if test $rv == 77 ; then
exit 77
elif test $rv -gt 0 ; then
exit 1
fi
done
Loading

0 comments on commit a92f2ad

Please sign in to comment.