#!/bin/bash

#
# script to fake the Simple PreProcessing Protocol 
# (in use with mystem for Russian)
#

user=${USER}
if [ -z "${user}" ]; then
  user=$(whoami);
fi


path=$(dirname $0)
if [ "${path#./}" != "${path}" ]; then
    path="$(pwd)/${path#./}"
fi
if [ "${path#/}" = "${path}" ]; then
    if [ "${path}" = "." ]; then
        path="$(pwd)";
    else 
        path="$(pwd)/${path}"
    fi
fi

file=/tmp/.sppp.${user}.$$

while read -d '' foo; do
    echo $foo | $path/LKBanalyzer $path/mystem.mapping
    echo ""
done

