summaryrefslogtreecommitdiff
path: root/corpus/tokenize-anything.sh
diff options
context:
space:
mode:
Diffstat (limited to 'corpus/tokenize-anything.sh')
-rwxr-xr-xcorpus/tokenize-anything.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/corpus/tokenize-anything.sh b/corpus/tokenize-anything.sh
index 028992cf..52739e81 100755
--- a/corpus/tokenize-anything.sh
+++ b/corpus/tokenize-anything.sh
@@ -3,11 +3,17 @@
ROOTDIR=`dirname $0`
SUPPORT=$ROOTDIR/support
-$SUPPORT/utf8-normalize.sh |
+if [[ $# == 1 && $1 == '-u' ]] ; then
+ NORMCMD=cat
+else
+ NORMCMD=$SUPPORT/utf8-normalize.sh
+fi
+
+$NORMCMD |
$SUPPORT/quote-norm.pl |
$SUPPORT/tokenizer.pl |
- sed -e 's/ al - / al-/g' |
+ sed -u -e 's/ al - / al-/g' |
$SUPPORT/fix-contract.pl |
- sed -e 's/^ //' | sed -e 's/ $//' |
- perl -e 'while(<>){s/(\d+)(\.+)$/$1 ./; s/(\d+)(\.+) \|\|\|/$1 . |||/; print;}'
+ sed -u -e 's/^ //' | sed -u -e 's/ $//' |
+ perl -e '$|++; while(<>){s/(\d+)(\.+)$/$1 ./; s/(\d+)(\.+) \|\|\|/$1 . |||/; print;}'