Add -V option to print spaCy version information
Change-Id: I1b196833c2100f1fcf3ce65db17536c1891894c7
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 0e45514..639e371 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -8,17 +8,18 @@
use_germalemma="True"
usage() {
- echo "Usage: $0 [-h] [-m MODEL] [-L] [-d] [-g]"
+ echo "Usage: $0 [-h] [-m MODEL] [-L] [-V] [-d] [-g]"
echo " -h Display this help message"
echo " -m MODEL Specify spaCy model (default: $model)"
echo " -L List available/installed models"
+ echo " -V Display spaCy version information"
echo " -d Disable dependency parsing (faster processing)"
echo " -g Disable GermaLemma (use spaCy lemmatizer only)"
exit 1
}
# Parse command line options
-while getopts "hm:Ldg" opt; do
+while getopts "hm:LVdg" opt; do
case $opt in
h)
usage
@@ -59,6 +60,25 @@
python /app/list_spacy_models.py
exit 0
;;
+ V)
+ echo "=== spaCy Version Information ===" >&2
+ python -c "import spacy; print(f'spaCy version: {spacy.__version__}')" >&2
+
+ # Check for GermaLemma
+ python -c "try:
+ import germalemma
+ try:
+ print(f'GermaLemma version: {germalemma.__version__}')
+ except AttributeError:
+ print('GermaLemma: installed (version unknown)')
+except ImportError:
+ print('GermaLemma: not installed')" >&2
+
+ # Show Python version
+ python -c "import sys; print(f'Python version: {sys.version.split()[0]}')" >&2
+
+ exit 0
+ ;;
d)
use_dependencies="False"
;;