-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Template merge] speller quality checks
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# colours | ||
if test -f "$GIELLA_CORE/scripts/termcolors.bash" ; then | ||
. "$GIELLA_CORE/scripts/termcolors.bash" | ||
fi | ||
# settings: | ||
TESTER=@DIVVUN_ACCURACY@ | ||
THRESHOLD=75 | ||
TYPOS="@top_srcdir@/test/data/typos.txt" | ||
ZHFST="@builddir@/../@[email protected]" | ||
|
||
if test x$TESTER = xfalse ; then | ||
printf "%sSKIP%s: missing divvunspell accuracy\n" "$light_blue" "$reset" | ||
exit 77 | ||
fi | ||
if test ! -f "$ZHFST" ; then | ||
printf "%sSKIP%s: spellchecker %s not found\n" \ | ||
"$light_blue" "$reset" "$ZHFST" | ||
exit 77 | ||
fi | ||
if test ! -f "$TYPOS" ; then | ||
printf "%sSKIP%s: test data %s not found\n" "$light_blue" "$reset" "$TYPOS" | ||
exit 77 | ||
fi | ||
# run accuracy on typos | ||
$TESTER -T $THRESHOLD "$TYPOS" "$ZHFST" | ||
rv=$? | ||
if test $rv == 77 ; then | ||
printf "%sSKIP%s\n" "$light_blue" "$reset" | ||
exit 77 | ||
elif test $rv -gt 0 ; then | ||
printf "%sFAIL%s\n" "$red" "$reset" | ||
exit 1 | ||
else | ||
printf "%sPASS%s\n" "$green" "$reset" | ||
exit 0 | ||
fi |