[net.sources] permuted index generator for news articles

lat@stcvax.UUCP (Larry Tepper) (01/16/85)

echo You better be running this through /bin/sh ...
echo We will be extracting 5 files
echo ''
echo extracting README ...
cat > README << 'End_Of_README'
If your site archives news, you will eventually get to the point
where you will have to move articles onto tape.

The enclosed files are useful for generating a permuted index
from the subjects of news articles.  The shell script ptx.sh
should be edited for your local configuration.  Two shell
variables will need to be changed:

	archdir=Parent directory of all files to be moved to tape
	subdirs=List of all subdirectories of archdir

With those two changes, you should to be able to run ptx.sh and
get a 132-column permuted index of all the files in subdirs.

This suite has been tested under 4.1 BSD.

Good luck.
End_Of_README
echo extracting ptx.sh ...
cat > ptx.sh << 'End_Of_ptx.sh'
#! /bin/sh
archdir= /archive/news
subdirs= net/sources net/bugs/4bsd net/bugs/uucp
cat /usr/lib/eign localignore > ignore
:
: Run in a sub-shell since ignore brkfile and ptxmac.nr are local files
( cd $archdir;
for d in $subdirs
do
cd $d
egrep '^Title:|^Subject:' [1-9]* | sed "s/^/$d-/
s/://
s/Subject://
s/Title://"
cd $archdir
done) |
ptx -i ignore -b brkfile -w 100 -f -r > ptx.nr
nroff ptxmac.nr ptx.nr
End_Of_ptx.sh
echo extracting brkfile ...
cat > brkfile << 'End_Of_brkfile'
=_^$#!%&()*+,-/:?@<>[]`";|
End_Of_brkfile
echo extracting localignore ...
cat > localignore << 'End_Of_localignore'
0
1
2
3
4
5
6
7
8
9
...
re
nf
anyone
need
needed
want
wanted
flame
actually
available
info
instead
none
null
orphaned
response
per
plea
please
unix
problem
problems
request
requests
question
questions
End_Of_localignore
echo extracting ptxmac.nr ...
cat > ptxmac.nr << 'End_Of_ptxmac.nr'
.ta 5.0iR 5.5iL 10.5iR 12.5iR
.ll 12.5i
.lt 12.5i
.lc   
.hy 14
.de HD		\" Page heading macro
'sp 3
..
.wh 0 HD	\" Set page heading macro trap
.de FO		\" Footer macro
'sp 2
.tl ''- % -''
'bp
..
.wh -6 FO	\" Set bottom margin macro trap
.de xx
.if !""\\$1" \\$1\fI\a\fR\\$2\t\\$3\fI\a\fR\t\\$5
.if !""\\$4" \t\\$2\t\\$3\fI\a\fR\\$4\t\\$5
.if ""\\$1\\$4" \t\\$2\t\\$3\fI\a\fR\t\\$5
..
.sp
.nf
.nj
.nr VS 12
.vs \n(VSp
End_Of_ptxmac.nr
exit 0
-- 
It's getting lonely around here...
{ihnp4 hao ucbvax!nbires}!stcvax!lat			Larry Tepper
Storage Technology, MD-3T, Louisville, CO 80028		+1 303 673 5435