Add first working conversion pipeline
diff --git a/scripts/udpipe2 b/scripts/udpipe2
new file mode 100755
index 0000000..ac7eec4
--- /dev/null
+++ b/scripts/udpipe2
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+usage() { echo "Usage: $0 [-r | -s <server>] [-m <model>] [-l] < c.conllu > c.ud.conllu" 1>&2; exit 1; }
+
+LOCAL_SERVER=http://compute.ids-mannheim.de:8001
+LINDAT_SERVER=https://lindat.mff.cuni.cz/services/udpipe/api
+
+server=${LOCAL_SERVER}
+model=de_hdt
+
+udpipe_server_is_operational () {
+ [ $(curl -s -o /dev/null -w "%{http_code}" ${1}/models) -eq 200 ]
+}
+
+if ! udpipe_server_is_operational $server; then
+ echo "WARING: Local server $server is not responding, defaulting to LINDAT server." >&2
+ server=$LINDAT_SERVER
+fi
+
+while getopts "s:m:rhl" o; do
+ case "${o}" in
+ r)
+ server=${LINDAT_SERVER}
+ ;;
+ s)
+ server=${OPTARG}
+ ;;
+ m)
+ model=${OPTARG}
+ ;;
+ l)
+ curl ${server}/models
+ exit 0
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+
+if ! udpipe_server_is_operational $server; then
+ echo "ERROR: Udpipe server $server is not operational." >&2
+ exit -1
+fi
+
+idx=1
+while [[ $idx -gt 0 ]]; do
+ idx=0
+ while IFS= read -r line && ( [[ $idx -lt 120000 ]] || ! [[ -z "$line" ]] ); do
+ $(( idx++ )) 2> /dev/null
+ echo "$line"
+# echo "$line" >&2
+ done > >(curl --silent -F data=@- -F model=${model} -F tagger= -F parser= ${server}/process | jq -j .result )
+done