summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-06 21:54:02 +0100
committerlassulus <lassulus@googlemail.com>2013-11-06 21:54:02 +0100
commitbfef0d684e958e363641a0cedbd1a4c55cb70471 (patch)
treed79bd3650d212adca156012f75d711b75df04022
parent2f0f23ec0e54aaa0dc7a9c28217f7daca72ea455 (diff)
parentd9b56ed3a1e1bb8a585c26301a979f1f2993a0eb (diff)
Merge branch 'master' of github.com:krebscode/painload
-rwxr-xr-xutil/bin/jbo47
1 files changed, 47 insertions, 0 deletions
diff --git a/util/bin/jbo b/util/bin/jbo
new file mode 100755
index 00000000..78408d4f
--- /dev/null
+++ b/util/bin/jbo
@@ -0,0 +1,47 @@
+#! /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@@
+
+ s|<SUB>1</SUB>|₁|g
+ s|<SUB>2</SUB>|₂|g
+ s|<SUB>3</SUB>|₃|g
+ s|<SUB>4</SUB>|₄|g
+ s|<SUB>5</SUB>|₅|g
+ s|<SUB>6</SUB>|₆|g
+ s|<SUB>7</SUB>|₇|g
+ s|<SUB>8</SUB>|₈|g
+ s|<SUB>9</SUB>|₉|g
+
+ s|<B>||g; s|</B>||g
+
+ s|<I> </I>|<I>_</I>|g
+ s|<I>||g; s|</I>||g
+
+ #s|<U>||g; s|</U>||g
+ s|<U>||g; s|</U>||g
+
+ s|&lt;|<|g
+ s|&gt;|>|g
+
+ s@^ *@@
+ $s/$/\n/
+'