Skip to content

Commit

Permalink
[Template Merge] pipx and giellaltgramtools
Browse files Browse the repository at this point in the history
  • Loading branch information
flammie committed Apr 12, 2024
1 parent 2b14f38 commit 848a0e2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
6 changes: 6 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ banner:
# 'nothing to be done for test'. By forwarding test to check we work around it.
test: check

# recurse all make devs just
dev:
$(MAKE) dev -C tools/tokenisers
$(MAKE) dev -C tools/grammarcheckers
$(MAKE) dev -C tools/tts

# Remove html tables created by some of the developer tools:
clean-local:
rm -f *.html
31 changes: 14 additions & 17 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.22.2
_giella_core_min_version=0.23.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 @@ -162,21 +162,7 @@ AS_IF([test "x$enable_yamltests" = "xcheck"],
AM_CONDITIONAL([CAN_YAML_TEST], [test "x$enable_yamltests" != xno])
################ LXML or pip ################
AS_IF([test "x$enable_grammarchecker" != "xno"],
[AM_PATH_PYTHON([3.5],, [:])
AX_PYTHON_MODULE(lxml)
AX_PYTHON_MODULE(pip)
AC_MSG_CHECKING([whether we can use lxml])
AS_IF([test "x$HAVE_PYMOD_LXML" != "xyes"],
AS_IF([test "x$HAVE_PYMOD_PIP" != "xno"],
AC_MSG_RESULT(no)
AC_MSG_WARN([lxml or pip is needed for grammarcheckers]),
AC_MSG_RESULT([no but using pip])),
AC_MSG_RESULT(yes))])
AM_CONDITIONAL([CAN_LXML], [test "x$HAVE_PYMOD_LXML" != xno])
AM_CONDITIONAL([CAN_PIP], [test "x$HAVE_PYMOD_LXML" != xno])
################ Generated documentation ################
# Check for awk with required feature:
AC_CACHE_CHECK([for awk that supports gensub], [ac_cv_path_GAWK],
Expand Down Expand Up @@ -676,6 +662,18 @@ AS_IF([test "x$enable_grammarchecker" = "xyes" -a "x$gt_prog_vislcg3" = "xno"],
AS_IF([test "x$enable_ci" = "xyes" -a "x$enableval" = "x"], [enable_grammarchecker=no])
AM_CONDITIONAL([WANT_GRAMCHECK], [test "x$enable_grammarchecker" != xno])
enableval=''
################ gtgramtool for grammarchecking ################
AC_PATH_PROG([GTGRAMTOOL], [gtgramtool], [false])
AS_IF([test "x$enable_grammarchecker" != "xno"],
AX_PYTHON_MODULE(pip)
AC_MSG_CHECKING([whether we have gtgramtool])
AS_IF([test x$GTGRAMTOOL = xfalse],
[AC_MSG_ERROR([gtgramtool is needed for --enable grammarchecker.
on debian/ubuntu: sudo apt update; sudo apt install pipx; pipx ensurepath
on macbrew: brew install pipx; pipx ensurepath
then: pipx install git+https://github.com/divvun/giellaltgramtools
])]),
AC_MSG_RESULT(yes))
# Enable all spellers - default is 'no'
AC_ARG_ENABLE([spellers],
Expand Down Expand Up @@ -1048,7 +1046,6 @@ 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:
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ checked_lemmas=checked_lemmas.txt
--exclude "(CmpN/Only|ShCmp|\+Cmp\/SplitR| Rreal | R | Rnoun |\+V\+|NOT-TO-LEMMATEST)" \
$source_files > $lemmas

if ! test -f $speller_dir/${GIELLA_LANG}.zhfst ; then
echo missing $speller_dir/${GIELLA_LANG}.zhfst
fi

####### Start testing: #######

$ospell $speller_dir/${GIELLA_LANG}.zhfst < $lemmas > $checked_lemmas

grep 'is NOT in the lexicon' $checked_lemmas > $rejected_lemmas

if [ -s $rejected_lemmas ] ; then
head $rejected_lemmas
echo see $rejected_lemmas for more
exit 1
fi

Expand Down

0 comments on commit 848a0e2

Please sign in to comment.