File: permbfcl.sh

package info (click to toggle)
libdsiutils-java 2.7.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,012 kB
  • sloc: java: 34,189; xml: 531; makefile: 51; sh: 47
file content (16 lines) | stat: -rwxr-xr-x 482 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash -ex

if [[ "$@" == "" ]]; then
	echo "USAGE: $(basename $0) FCL" 1>&2
	echo "The list of string will be read from standard input in UTF-8 encoding." 1>&2
	exit 1
fi

PERM=$(mktemp)
LEXFCL=$(mktemp)

nl -v0 -nln | LC_ALL=C sort -S2G -T. -k2 | tee >(cut -f1 | tr -d ' ' >$PERM) | cut -f2 | java -server it.unimi.dsi.big.util.FrontCodedStringBigList -u $LEXFCL

java -server it.unimi.dsi.big.util.PermutedFrontCodedStringBigList -i -t $LEXFCL $PERM $1

rm -f $LEXFCL $PERM