summaryrefslogtreecommitdiff
path: root/language/thai/thailatex/hyphen/test-hyphen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'language/thai/thailatex/hyphen/test-hyphen.sh')
-rwxr-xr-xlanguage/thai/thailatex/hyphen/test-hyphen.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/language/thai/thailatex/hyphen/test-hyphen.sh b/language/thai/thailatex/hyphen/test-hyphen.sh
new file mode 100755
index 0000000000..77922532fd
--- /dev/null
+++ b/language/thai/thailatex/hyphen/test-hyphen.sh
@@ -0,0 +1,29 @@
+#/bin/sh
+
+cat > hyphtest.tex << EOT
+\\documentclass{article}
+\\usepackage[thai]{babel}
+\\usepackage[utf8x]{inputenc}
+
+\\begin{document}
+EOT
+
+sed -e 's/-//g; s/.*/\\showhyphens{&}/' thai.dic >> hyphtest.tex
+
+cat >> hyphtest.tex << EOT
+\\end{document}
+EOT
+
+pdflatex hyphtest.tex \
+ | grep '^\[\]' | cut -d' ' -f3 | iconv -f tis-620 -t utf-8 > hyphres.dic
+
+diff -u thai.dic hyphres.dic > hyph.diff
+
+ERRS=`grep '^+[^+]' hyph.diff | wc -l | cut -d' ' -f1`
+if test ${ERRS} -ne 0; then
+ echo "${ERRS} words are not correctly hyphenated. Check hyph.diff for the list."
+ exit 1
+fi
+
+exit 0
+