#! /bin/sh
# usage: jbo WORDS...
set -euf
if test $# = 0; then
while read line; do
if test "${clear-}" = true; then
echo -n 'c'
fi
"$0" "$line"
done
exit
fi
echo "$*" |
tr 'h' "'" |
jbofihe -H |
tr '\n' ' ' |
sed -r '
s@?(HTML|HEAD|TITLE|BODY|FONT)[^>]*>@@g
s@Lojban translation@@
' | {
sed 's:[^>]*:\n&\n:g' |
sed '/^/y/0123456789/₀₁₂₃₄₅₆₇₈₉/' |
tr -d '\n' |
sed 's:\?SUB>::g'
} |
sed -r '
s||[32m|g; s||[m|g
s| |_|g
s||[31m|g; s||[m|g
#s||[4m|g; s||[m|g
s|||g; s|||g
s|<|<|g
s|>|>|g
s@^ *@@
$s/$/\n/
'