summaryrefslogtreecommitdiff
path: root/corpus/tokenize-anything.sh
blob: a20a022fb2a0afc158e968175dd552aecbab9fcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

ROOTDIR=`dirname $0`
SUPPORT=$ROOTDIR/support

if [[ $# == 1 && $1 == '-u' ]] ; then
    NORMARGS="--batchline"
else
    NORMARGS=""
fi

$SUPPORT/utf8-normalize.sh $NORMARGS |
  $SUPPORT/quote-norm.pl |
  $SUPPORT/tokenizer.pl |
  sed -u -e 's/ al - / al-/g' |
  $SUPPORT/fix-contract.pl |
  sed -u -e 's/^ //' | sed -u -e 's/ $//' |
  perl -e '$|++; while(<>){s/(\d+)(\.+)$/$1 ./; s/(\d+)(\.+) \|\|\|/$1 . |||/;  print;}'