/usr/bin/dictfmt_index2word is in dictfmt 1.12.1+dfsg-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #!/bin/sh
#
# By Aleksey Cheusov (vle@gmx.net)
#
usage (){
printf "\
Converts .index file from DICTD database to the index file .word\n\
usage: dictfmt_index2word [OPTIONS] [files...]\n\
OPTIONS:\n\
--help display this screen\n\
all other -X and --XXX options are passed to dictfmt -i\n\
"
}
LC_ALL=C
export LC_ALL
# Processing arguments
while [ $# != 0 ]; do
case $1 in
--help)
usage
exit 0;;
-*)
args="$args $1";;
*)
break;;
esac
shift
done
if test $BASH; then
exit_="echo \${PIPESTATUS[@]} | egrep '^0( 0)*$' >/dev/null"
else
exit_='exit $?'
fi
awk '
BEGIN {
FS = OFS = "\t"
offs = 0
}
{
len = length($0)
count = split($1, words, /[[:space:][:punct:]]+/)
$2 = offs
$3 = 0
orig_token1 = $1
if (count > 1){
for (i = 1; i <= count; ++i){
$1 = ""
for (j = i; j <= count; ++j){
if (j > i)
$1 = $1 " "
$1 = $1 words [j]
if ($1 != orig_token1){
print $0
}
}
}
}
offs += len+1
}
' "$@" | dictfmt -i $args | uniq
eval $exit_
|