home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: goer@midway.uchicago.edu (Richard L. Goerwitz)
- Subject: v23i073: quranref - Holy Qur'an word and passage based retrievals, Part07/08
- Message-ID: <1991Oct19.022351.13129@sparky.imd.sterling.com>
- X-Md4-Signature: 89c73d8d8777b3e215c99bf7a5c5a2d6
- Date: Sat, 19 Oct 1991 02:23:51 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: goer@midway.uchicago.edu (Richard L. Goerwitz)
- Posting-number: Volume 23, Issue 73
- Archive-name: quranref/part07
- Environment: Icon
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is quranref.07 (part 7 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file makeind.icn continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 7; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping makeind.icn'
- else
- echo 'x - continuing file makeind.icn'
- sed 's/^X//' << 'SHAR_EOF' >> 'makeind.icn' &&
- X how_many_bitmaps := ior(*inverse_set, inverse_signal)
- X write_int(outbitmaps, how_many_bitmaps, bits_needed)
- X every write_int(outbitmaps, !inverse_set, bitmap_length)
- X } else {
- X # ...otherwise (if we have a reasonable number of keys), store
- X # the locations "straight" and don't set the inverse_signal bit.
- X write_int(outbitmaps, how_many_bitmaps, bits_needed)
- X # Having written the bitmap count, now write the bitmaps proper
- X # to the bitmap file.
- X if index_lst[i] == ""
- X then
- X # Bitmaps for "" are guaranteed to be sorted.
- X every write_int(outbitmaps, !sort(index_lst[i+1]),bitmap_length)
- X else
- X every write_int(outbitmaps, !index_lst[i+1], bitmap_length)
- X }
- X }
- X
- X # Close files. Return number of keys processed (any better ideas??)
- X every close(outtokens | outbitmaps)
- X return *index_lst / 2 # return number of keys in index file
- X
- Xend
- X
- X
- X#
- X# store_bitmaps_and_offsets
- X#
- X# Open the original text file (backup_file). Read in bitmaps and
- X# write out compressed texts to fname. Write out bitmaps and the
- X# offsets of the text they go with in fname to the .UNT file. Store
- X# locations of bitmaps in the UNT file to the .OFS file. Note that
- X# the full bitmap is not stored. Rather only the first upto_field
- X# fields are stored. Normally upto_field = IS.no - 1. The scheme is
- X# thus as follows: bitmap -> .OFS file -> .UNT file -> main text file.
- X# The OFS file is read into memory at run-time, and stores only the
- X# locations of major blocks in the .UNT file. The .UNT file has a
- X# full list of pointers into the main text file, and once a bitmap
- X# is located there, the exact location for it in the main file can
- X# be retrieved.
- X#
- Xprocedure store_bitmaps_and_offsets(fname, unt_fname, backup_fname,
- X upto_field, huffman_table)
- X
- X local last_major_division, major_division, bitmap_offset_table,
- X out_compress, in_main_text, out_locations, location, firstline,
- X line, value
- X
- X out_compress := open(fname, "w")
- X out_locations := open(unt_fname, "w")
- X in_main_text := open(backup_fname) |
- X abort("store_bitmaps_and_offsets","can't open "||backup_fname,5)
- X bitmap_offset_table := table()
- X
- X last_major_division := -1 # initialize to an impossible value
- X until match("::", firstline := read(in_main_text))
- X every line := (firstline | !in_main_text) do {
- X line ? {
- X if not ="::" then
- X value ||:= line || "\n"
- X else {
- X location := tab(0)
- X major_division :=
- X ishift(digits_2_bitmap(location),
- X -((IS.no - upto_field) * IS.len))
- X if last_major_division ~= major_division
- X then {
- X # Write to the bitmap offset table the major division,
- X # and then our position in the UNT file (which records
- X # the locations for all bitmaps).
- X insert(bitmap_offset_table, major_division,
- X where(out_locations))
- X last_major_division := major_division
- X }
- X # Write compressed text to original filename; then write
- X # the current location marker to the UNT file, followed by
- X # our position in out_compress (i.e. the place where the
- X # next block of compressed text will begin).
- X \value & writes(out_compress,
- X block_encode(trim(value,"\n"), huffman_table)) |
- X # We should abort with an I/O error if there is no
- X # on the device. I ran into a problem, though, in
- X # which writes were repeatedly attempted to a full
- X # filesystem.
- X abort("store_bitmaps...", "can't write to "|| fname, 6)
- X write(out_locations, location, "\t", where(out_compress))
- X value := ""
- X }
- X }
- X }
- X
- X \value & writes(out_compress,
- X block_encode(trim(value,"\n"), huffman_table)) |
- X abort("store_bitmaps...", "can't write to "|| fname, 6)
- X writes(out_compress, block_encode(trim(\value,"\n"), huffman_table))
- X every close(in_main_text | out_compress | out_locations)
- X return bitmap_offset_table
- X
- Xend
- X
- X
- X#
- X# write_bitmaps_and_offsets
- X#
- X# Does the actual writing of bitmaps and offsets to a file. Receives
- X# a table of bitmaps cut down to upto_field fields. Shinking the
- X# bitmaps lessens the size of the resulting file, but requires a bit
- X# more I/O when it comes time to look something up.
- X#
- Xprocedure write_bitmaps_and_offsets(ofs_filename, t, upto_field)
- X
- X local outtext, tmp_list, i, offset_length,
- X block_size, stored_bitmap_length
- X
- X outtext := open(ofs_filename, "w") |
- X abort("write_bitmaps_and_offsets","can't open "||ofs_filename,5)
- X stored_bitmap_length := ((IS.len * upto_field) <= seq(0,8))
- X tmp_list := sort(t, 3)
- X
- X every i := 1 to *tmp_list-1 by 2 do {
- X
- X # Number of bits needed to hold offset.
- X offset_length := (*exbase10(tmp_list[i+1], 2) <= seq(0,8))
- X # Number of bytes needed to hold bitmap and offset (both).
- X block_size := (stored_bitmap_length + offset_length) / 8
- X
- X # We could just code the length of the offset, since the bitmap's
- X # length is fixed (and known). Seems better to code the block's
- X # total length just in case something gets screwed up. An 8-bit
- X # limit means the bitmap+offset length cannot exceed 2^9-1 (255)
- X # characters.
- X if block_size > 255 then
- X abort("write_bitmaps_and_offsets","bitmap+offset too big",15)
- X write_int(outtext, block_size, 8)
- X write_int(outtext, tmp_list[i], stored_bitmap_length)
- X write_int(outtext, tmp_list[i+1], offset_length)
- X
- X }
- X
- X return
- X
- Xend
- X
- X
- X#
- X# write_limits
- X#
- X# Writes out the bitmaps that will be needed in order for expandrf()
- X# to be able to know when the rollover field rolls over.
- X#
- Xprocedure write_limits(out_fname, in_fname, r_field)
- X
- X local in, out, shift_bits_out, bitmap_length, bitmaps_read,
- X line, bitmap, short_bitmap, old_bitmap
- X
- X in := open(in_fname) |
- X abort("write_limits","can't open "||in_fname,5)
- X out := open(out_fname, "w") |
- X abort("write_limits","can't open "||out_fname,5)
- X r_field <= IS.no |
- X abort("write_limits","-l value should not exceed that of -n",50)
- X shift_bits_out := -(((IS.no-r_field)+ 1) * IS.len)
- X bitmap_length := ((IS.len * IS.no) <= seq(0,8))
- X bitmaps_read := 0
- X
- X while line := read(in) do {
- X line ? {
- X bitmaps_read +:= 1
- X bitmap := digits_2_bitmap(tab(find("\t"))) # in indexutl.icn
- X short_bitmap := ishift(bitmap, shift_bits_out)
- X if ishift(\old_bitmap, shift_bits_out) ~== short_bitmap
- X then write_int(out, old_bitmap, bitmap_length)
- X old_bitmap := bitmap
- X }
- X }
- X
- X write_int(out, \old_bitmap, bitmap_length)
- X every close(in | out)
- X return bitmaps_read
- X
- Xend
- SHAR_EOF
- echo 'File makeind.icn is complete' &&
- true || echo 'restore of makeind.icn failed'
- rm -f _shar_wnt_.tmp
- fi
- # ============= gettokens.icn ==============
- if test -f 'gettokens.icn' -a X"$1" != X"-c"; then
- echo 'x - skipping gettokens.icn (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting gettokens.icn (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'gettokens.icn' &&
- X############################################################################
- X#
- X# Name: gettokens.icn
- X#
- X# Title: get tokens from text-base file
- X#
- X# Author: Richard L. Goerwitz
- X#
- X# Version: 1.2
- X#
- X############################################################################
- X#
- X# Tokenizing routine used by makeind.icn to create index.
- X#
- X############################################################################
- X#
- X# See also: ./makeind.icn
- X#
- X#############################################################################
- X
- X# declared in ./indexutl.icn (q.v.)
- X# global IS
- X#
- X# One idea for gettokens, good for small indices. Uses field separator
- X# (IS.FS). Also uses (slow) findre. Farther below is a less flexible
- X# version of gettokens which runs faster.
- X#
- X#procedure gettokens(is_case_sensitive)
- X#
- X# # Used within a scanning expression. Returns tokens in
- X# # &subject[&pos:0] (&pos normally = 1). Tokens are stretches of
- X# # text separated by the IS.FS field separator. This
- X# # field separator is a nawk style FS regular expression. If null,
- X# # it gets defined as ~(&digits++&letters).
- X#
- X# local token
- X# static non_alphanums
- X# initial non_alphanums := ~(&digits ++ &letters ++ '-')
- X#
- X# /IS.FS := non_alphanums
- X#
- X# while token := tab(findre(IS.FS)) do {
- X# tab(__endpoint)
- X# tab(many('\'')) # unfortunate by-product of findre's weakness
- X# if \is_case_sensitive
- X# then suspend "" ~== trim(token,'\t ')
- X# else suspend map("" ~== trim(token,'\t '))
- X# }
- X#
- X# # Return the rest of &subject. Even though we're not tabbing
- X# # upto FS, this is normally what the user intends.
- X# if \is_case_sensitive
- X# then return "" ~== trim(tab(0),'\t ')
- X# else return map("" ~== trim(tab(0),'\t '))
- X#
- X#end
- X
- Xprocedure gettokens(is_case_sensitive)
- X
- X # Used within a scanning expression. Returns tokens in
- X # &subject[&pos:0] (&pos normally = 1). Tokens are stretches of
- X # text separated by an optional apostrophe or dash, then any
- X # stretch of non-alphanumeric characters, then an optional apos-
- X # trophe.
- X
- X local token
- X static alphanums, wordchars
- X initial {
- X alphanums := &digits ++ &letters ++ '-'
- X wordchars := alphanums ++ '\''
- X }
- X
- X tab(upto(alphanums))
- X while token := tab(many(wordchars)) do {
- X if \is_case_sensitive
- X then suspend "" ~== trim(token,'\t \'-')
- X else suspend map("" ~== trim(token,'\t \'-'))
- X tab(upto(alphanums))
- X }
- X
- Xend
- SHAR_EOF
- true || echo 'restore of gettokens.icn failed'
- rm -f _shar_wnt_.tmp
- fi
- # ============= Makefile.dist ==============
- if test -f 'Makefile.dist' -a X"$1" != X"-c"; then
- echo 'x - skipping Makefile.dist (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting Makefile.dist (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'Makefile.dist' &&
- X##########################################################################
- X#
- X PROGNAME = quranref
- X#
- X##########################################################################
- X#
- X# User-modifiable section. Read carefully! You will almost
- X# certainly have to change some settings here.
- X#
- X
- X#
- X# Destination directory for binaries; library directory for auxiliary
- X# files. Owner and group for public executables. Leave the trailing
- X# slash off of directory names.
- X#
- XDESTDIR = /usr/local/bin
- X# DESTDIR = $(HOME)/bin
- XLIBDIR = /usr/local/lib/$(PROGNAME)
- X# LIBDIR = $(HOME)/$(PROGNAME)
- X# LIBDIR = /usr/local/share/lib/$(PROGNAME)
- XOWNER = root #bin
- XGROUP = root #bin
- X
- X#
- X# Name of your icon compiler and compiler flags.
- X#
- XICONC = /usr/icon/v8/bin/icont
- X
- X# Flags for $(ICONC) (these may vary for different versions and/or
- X# implementations). If you get messages like "out of X table space,"
- X# then you will need to adjust these. Note that they apply only to
- X# the interpreter. Comment everything out but the -u for the
- X# compiler.
- XIFLAGS = -u -Sc 400 -Sg 400 -Si 2000 -Sn 4000 -SF 40
- X
- X#
- X# Names of Quran files should all be sorted, consisting of a three-
- X# digit prefix, followed by a period, and a title. Cat-ing them is
- X# sufficient, since the shell automatically takes them in order. Use
- X# zcat if your files are compressed. Note that I assume the original
- X# distribution and form, as announced in soc.religion.islam by Cary
- X# Maguire), and as archived at princeton.edu (pub/Quran.tar.Z).
- X#
- XCAT = cat [0-9][0-9][0-9].*
- X# CAT = zcat [0-9][0-9][0-9].*
- X
- X#
- X# Change these only if you're sure of what you're doing
- X#
- XSHELL = /bin/sh
- XMAKE = make
- XSHAR = shar
- X
- X#
- X# Maximum number that any database location field will have to
- X# contain. For a standard Quran, this figure is 286 (the Cow).
- X#
- XMAXFIELDS = 286
- X
- X
- X###########################################################################
- X#
- X# Don't change anything below this line.
- X#
- X
- XRTVFILE = qur.rtv
- XCONVERTER = qur2rtv
- X
- XCONVERTSRC = $(CONVERTER).icn
- X
- XINDEXER = makeind
- XINDEXSRC = $(INDEXER).icn gettokens.icn indexutl.icn huffcode.icn \
- X outbits.icn
- X
- XDUMMY_FILE = index.done
- XMAINFILE = bibleref
- X
- XSEARCHSRC = $(MAINFILE).icn ref2bmap.icn name2num.icn convertb.icn \
- X listutil.icn passutil.icn readfile.icn srchutil.icn complete.icn \
- X ipause.icn rewrap.icn binsrch.icn bmp2text.icn initfile.icn \
- X retrieve.icn indexutl.icn retrops.icn whatnext.icn iolib.icn \
- X iscreen.icn findre.icn version.icn huffcode.icn inbits.icn
- X
- Xall: $(DUMMY_FILE) $(PROGNAME)
- X
- X$(DUMMY_FILE):
- X @echo ""
- X @echo "This may take a while (about 1 minute/MB on a Sun4)."
- X @echo ""
- X @sleep 3
- X $(ICONC) $(IFLAGS) -o $(CONVERTER) $(CONVERTSRC)
- X $(CAT) $(RAWFILES) | $(CONVERTER) > $(RTVFILE)
- X @echo ""
- X @echo "This will take a long time (c. 1 hour/MB on a Sun4)."
- X @echo "Kids, don't even *think* of trying this at home."
- X @echo ""
- X @sleep 3
- X $(ICONC) $(IFLAGS) -o $(INDEXER) $(INDEXSRC)
- X $(INDEXER) -f $(RTVFILE) -m $(MAXFIELDS) -n 2 -l 2
- X @rm -f *.BAK
- X @echo ""
- X @echo "I'm creating a $(DUMMY_FILE) file, indicating that the"
- X @echo "indexing process is done. Once the data files are moved,"
- X @echo "this file remains, preventing an accidental remake of the"
- X @echo "data files. If, poor soul, you *want* a total remake, you"
- X @echo 'will need to remove this file (see "clobber" below).'
- X @echo ""
- X @sleep 4
- X touch $(DUMMY_FILE)
- X
- X$(PROGNAME): $(SEARCHSRC)
- X @echo ""
- X @echo "Compiling main executable, $(PROGNAME)."
- X @echo ""
- X @sleep 2
- X $(ICONC) $(IFLAGS) -o $(PROGNAME) $(SEARCHSRC)
- X
- X$(MAINFILE).icn: $(MAINFILE).src
- X @echo ""
- X @echo "Hardcoding default datafile path ($(LIBDIR))."
- X @echo ""
- X @sleep 2
- X sed "s|/usr/local/lib/bibleref/kjv.rtv|$(LIBDIR)/$(RTVFILE)|; s|Bible|Quran|g" $(MAINFILE).src > $(MAINFILE).icn
- X
- X$(CONVERTER): $(CONVERTSRC)
- X $(ICONC) $(IFLAGS) -o $(CONVERTER) $(CONVERTSRC)
- X
- X$(INDEXER): $(INDEXSRC)
- X $(ICONC) $(IFLAGS) -o $(INDEXER) $(INDEXSRC)
- X
- X
- X##########################################################################
- X#
- X# Pseudo-target names (install, clean, clobber)
- X#
- X#
- X
- X# Pessimistic assumptions regarding the environment (in particular,
- X# I don't assume you have the BSD "install" shell script).
- Xinstall: all
- X @echo ""
- X @echo "Creating (if need be) necessary directories, and moving"
- X @echo "executables/data files to their correct locations, with"
- X @echo "the permissions and the ownership you specified in the"
- X @echo "makefile (i.e. $(OWNER))."
- X @echo ""
- X -test -d $(DESTDIR) || mkdir $(DESTDIR) && chmod 755 $(DESTDIR)
- X cp $(PROGNAME) $(DESTDIR)/$(PROGNAME)
- X -chgrp $(GROUP) $(DESTDIR)/$(PROGNAME)
- X -chown $(OWNER) $(DESTDIR)/$(PROGNAME)
- X -test -d $(LIBDIR) || mkdir $(LIBDIR) && chmod 755 $(LIBDIR)
- X mv xxx* $(RTVFILE) $(LIBDIR)/
- X -chgrp $(GROUP) $(LIBDIR)
- X -chown $(OWNER) $(LIBDIR)
- X -chgrp $(GROUP) $(LIBDIR)/xxx* $(LIBDIR)/$(RTVFILE)
- X -chown $(OWNER) $(LIBDIR)/xxx* $(LIBDIR)/$(RTVFILE)
- X @echo ""
- X @echo "Done installing."
- X @echo ""
- X
- X#
- X# Cleanup
- X#
- Xclean:
- X @echo ""
- X @echo "Minor cleanup underway (major = make clobber)."
- X @echo ""
- X rm -f $(CONVERTER) $(INDEXER) $(PROGNAME)
- X
- X# Be careful; use this target, and you'll be back to square one.
- Xclobber: clean
- X @echo ""
- X @echo "You're in for a complete remake if you do this. Here"
- X @echo "are the files that will get clobbered (note especially"
- X @echo "the raw Qur'an files):"
- X @echo ""
- X @echo $(RAWFILES) xxx*.??? $(RTVFILE) $(DUMMY_FILE) $(MAINFILE).icn
- X @echo ""
- X @echo 'If you really want a total remake, then make "honestly."'
- X @echo ""
- X
- Xhonestly:
- X @echo ""
- X @echo "Okay, you asked for it."
- X @echo ""
- X @sleep 4
- X rm -f $(RAWFILES) xxx*.??? $(RTVFILE) $(DUMMY_FILE) $(MAINFILE).icn
- SHAR_EOF
- true || echo 'restore of Makefile.dist failed'
- rm -f _shar_wnt_.tmp
- fi
- # ============= README ==============
- if test -f 'README' -a X"$1" != X"-c"; then
- echo 'x - skipping README (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting README (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'README' &&
- X--------
- X
- X
- XProgram: Quranref (built on top of Bibleref, a Bible concordance
- X program archived on cs.arizona.edu [icon/contrib/bible-
- X ref-2.1.tar.Z])
- X
- XPurpose: Perform word and passage-based retrievals on the M. H.
- X Shakir's translation of the Holy Qur'an.
- X
- XLanguage: Icon (ftp-able from cs.arizona.edu [icon/interpreter])
- X
- XFiles: qur2rtv.icn bibleref.src convertb.icn listutil.icn
- X name2num.icn passutil.icn readfile.icn ref2bmap.icn
- X srchutil.icn
- X
- XRequires: Icon version 8, a working, up-to-date Icon Program Library
- X (see below on IPATH), and M. H. Shakir's translation of the
- X Holy Qur'an, as archived by Cary Maguire on princeton.edu
- X (pub/Quran.tar.Z).
- X
- X
- X--------
- X
- X
- XOverview:
- X
- X This package, Quranref, offers simple tools for word and
- Xpassage-based access to M. H. Shakir's translation of the Holy Qur'an.
- XQuranref is quick, and fairly easy to install (assuming you possess
- Xthe machine readable text, a sufficiently powerful machine, and know a
- Xlittle about Icon). It will also run with stock terminals - even
- Xnasty old ones that leave magic cookies on your screen. Quranref
- Xwill, however, put a bit of a dent in your mass storage resources.
- XYour 900k or so Qur'an text will get block Huffman encoded, which will
- Xbring it down to about 500k. The freed space, however, will be
- Xgobbled up immediately by some 500k of auxiliary files, and by the
- X180k executable (more if you compile, rather than interpret). In-core
- Xrequirements for the executable start at about 300k, and go up from
- Xthere (if your searches are complex enough, you could easily eat up a
- Xmegabyte or two). In brief: Quranref enjoys dining on your memory
- Xresources. Once set up, though, it can operate with fairly minimal
- Ximpact on the CPU.
- X With Quranref, you can perform most of the more basic,
- Xlow-level functions commercial browsing packages offer (and perhaps a
- Xfew not found in some of the commercial Qur'an study packages). You
- Xcan, for example,
- X
- X - retrieve any passage by section:verse number
- X - move forward or backward relative to the retrieved passage
- X - search the entire Qur'an for words and/or word-patterns
- X - search for word co-occurrences (or the absence thereof)
- X - save passages and/or passage-lists for use with an editor
- X
- XAlthough this program is hardly the product of any major research
- Xeffort :-), it should prove sophisticated enough for casual use. Its
- Xmain fault right now is that it relies on a newly scanned text which
- Xis positively rife with errors. The high number of errors is nothing
- Xunusual for a text put into machine readable form by current OCR
- Xtechnology, so no insult is intended to the people who rendered us
- Xthis great service. It is merely a fact about the current
- Xdistribution that should be noted before attempting any serious
- Xresearch.
- X
- X
- X--------
- X
- X
- XInstallation:
- X
- X The following set-up and installation instructions tacitly
- Xassume that you received Quranref as a shell archive, with no prebuilt
- Xdata files. If you snarfed the distribution from an ftp site with the
- Xdata files already built, you can skip all the instructions about
- Xobtaining and indexing the Princeton scan of M. H. Shakir's Qur'an
- Xtext. If there's any doubt over whether your data files are prebuilt,
- Xcheck to see if the file "index.done" exists in your Quranref source
- Xdirectory. If it does, then your data files have already been built.
- XOtherwise, you'll need to do a "from scratch" installation.
- X In brief, the setup process consists of the following steps
- X(those with prebuilt data files only need to do the starred ones):
- X
- X * make sure Icon is installed & your IPATH variable is set
- X - ftp the Qur'an from princeton.edu, and unarchive it
- X - link the Qur'an files to the dir where you unpacked Quranref
- X * modify the makefile to suit your machine
- X * make
- X
- XAlthough I will discuss it below briefly, installation of the Icon
- Xprogramming language falls outside the scope of this manual. I will
- Xtherefore begin setup instructions with directions on how to get the
- Xnecessary machine-readable text, and on how to set this text up for
- Xindexing.
- X In order to obtain the Qur'an text, you must ftp the necessary
- Xfiles from princeton.edu. If you have direct internet connections,
- Xjust type "ftp princeton.edu," and when you are asked for a password,
- Xtype "anonymous." Type your e-mail address as your password, and you
- Xwill be logged in. Change to the "pub" directory by typing "cd pub."
- XTo retrieve the Qur'an package, type "binary" or "type binary," and
- Xthen request a transfer by typing "get Quran.tar.Z". When the server
- Xlets you know the transfer is done, type "bye." Back at your local
- XUNIX machine, unpack the Qur'an files by typing "zcat Quran.tar.Z |
- Xtar -xf -" (this will set up a "Quran" directory, and fill it with the
- Xappropriate files). Once you've unpacked the Qur'an files, change
- Xyour current directory to the one you unpacked this Quranref
- Xdistribution in, and then link or copy the Qur'an files you just
- Xunpacked to the current directory (i.e. you must type "ln [-S]
- XQuran-directory/* ."; in place of "ln" or "ln -S" you can also use
- X"cp").
- X At this point, UNIX novices will probably need some technical
- Xhelp, since installing Quranref requires modifying the set-up files,
- Xand assumes you know at least something about the UNIX file structure,
- Xmakefiles, and operating environment.
- X When finished linking your files to the Quranref source
- Xdirectory, locate the Makefile.dist file included with this package
- Xand read it. Copy it to "Makefile." If you find you must modify any
- Xof the user-configurable sections, then edit them as you see fit. Pay
- Xspecial attention to the RAWFILES variable. Also, be sure to change
- XDESTDIR, LIBDIR, USER and GROUP variables to appropriate values for
- Xyour machine. If you are doing a "from scratch" installation, check
- Xto be sure that the variable CAT is set to either "cat" or "zcat,"
- Xdepending on whether you have compressed the 114 basic text files, or
- Xnot.
- X Assuming you've modified the makefile correctly, you can then
- Xsimply type "make." If you are installing from scratch, then you
- Xmight as well have lunch. The entire reformatting, collating, coding,
- Xcompressing, end indexing process takes as much as a full three hours
- Xon a medium-range workstation. Don't even *think* of indexing on a
- Xsystem with less than 5 meg of core memory and/or a lot of swap space.
- XIf you are really savvy about Icon storage management, you can try
- Xsetting your regions to have larger values than the defaults. This
- Xwon't cause the indexing program to take up any less RAM. It may,
- Xhowever, decrease the amount of time it takes to index.
- X If you find you get messages like "out of space in X region"
- Xor "system stack overflow," then you are probably using an Icon
- Ximplementation that doesn't know how to make its own special block and
- Xstring regions bigger (e.g. on the NeXT it can't, because Mach doesn't
- Xknow about sbrk()). If the make aborts with such a message, you will
- Xneed to set the sizes manually. Try starting a new shell, and then
- Xtyping (assuming [ba|k]sh):
- X
- X HEAPSIZE=5000000
- X STRSIZE=1000000
- X export HEAPSIZE STRSIZE
- X
- XIf you are using (t)csh, then type
- X
- X setenv HEAPSIZE=5000000
- X setenv STRSIZE=1000000
- X
- XYou may need to increase STRSIZE. Can't hurt, if you have the memory,
- Xto set it to some rediculous amount like 5000000. Otherwise, start
- Xlow, and creep up to whatever minimum amount seems needed. When done,
- Xback out of the current shell, or unsetenv these variables.
- X Once you've gotten past the indexing "hump" (which is quite a
- Xhump for people starting from scratch), you are free to install. Su
- Xroot first, if you plan on making the executables public, then "make
- Xinstall." Again, be sure the directories and ownership conventions
- Xare set correctly in the makefile.
- X Let me emphasize here that Quranref assumes the existence on
- Xyour system, not only of Icon interpreter or compiler, but also of an
- Xup-to-date Icon Program Library. There are several routines included
- Xin the IPL which Quranref uses. Make sure the system administrators
- X(if "they" are not you :-)) have put the IPL online, and have
- Xtranslated the appropriate object modules. Set your IPATH (or, for
- Xthe compiler, LPATH) environment variable to point to the place where
- Xthose modules reside, and you should be in business. Note that I've
- Xheard of people having problems with old IPL routines silently
- Xfailing, resulting in a truncated .IS file. Suspect you have fallen
- Xvictim to this problem if you get through the installation process
- Xfine, and then start Quranref up, only to have it terminate with an
- Xerror message and a trace reporting that a null expression was
- Xreceived in place of a record.
- X Any IPL material that I've written myself has been packed with
- XQuranref, by the way. I'm constantly tweaking these programs, and I
- Xjust want to be sure everyone has the latest version. IPL programs
- Xwritten by other people, though, have not been built into the Quranref
- Xdistribution. If you don't have the IPL, ftp it from cs.arizona.edu
- Xalong with the full Icon distribution, and get the updates as well
- X(~ftp/icon/library). If all else fails, write to me and I'll package
- Xup the necessary routines for you :-(. In general, the best solution
- Xis simply to keep your Icon run-time and support systems in sync with
- Xthe latest revisions from the U. of Arizona. They are public domain,
- Xafter all, and the installation is pretty simple.
- X
- X
- X--------
- X
- X
- XRunning Quranref:
- X
- X There is precious little in the way of documentation on
- Xrunning Quranref. This is it. I wrote the program originally as a
- Xtest wrapper to put around some software I'm using for personal
- Xresearch purposes. In this incarnation it functioned as a Bible
- Xresearch program for Christians and Jews. This package was tried out
- Xhere at home by my wife and 5 year-old. The 5 year-old likes to break
- Xprograms I write. Thanks to him, the visual interface had all of the
- Xobvious bugs worked out. Others have checked other features, and have
- Xcompared retrieval lists to the listings in paper concordances, and
- Xhave found them to be complete. This program - Quranref - is much
- Xless well-tested. It's a younger program, and the text it's based on
- Xhas not been put through a rigorous editing process yet. Expect the
- Xusual growing pains.
- X When it is first invoked, Quranref will print a little message
- Xabout initializing one or another of its auxiliary files. After
- Xseveral seconds, this message will disappear - replaced by a prompt
- Xwhich asks for a passage reference or "f" (to find a word or
- Xword-pattern).
- X If you are interested in looking at a specific passage in the
- XQur'an, type it in. Use the section or chapter number, followed by
- Xthe passage or verse number (as in "1:3" or "2:201"). If the passage
- Xdoesn't exist, then you'll get an error message (note that some
- Xpassages appear to be missing due to scan errors and missing newlines
- Xin the scanned text).
- X If want to use Quranref in order to locate a word-pattern,
- Xrather than a passage, type "f" and press return at the main command
- Xloop. Just about every command in Quranref is invoked by typing a
- Xsingle letter + a carriage return. It's simple and consistent, and
- Xlets me keep the terminal in its normal mode. If at any time you must
- Xtype in additional input, Quranref will ask you for that input. The
- X"f" (find) command is one such case.
- X After you press f+return, Quranref will ask you to input a
- Xword. This "word" can be a simple string. It can also be an
- Xegrep-style pattern:
- X
- X (dis|un)?believers?
- X dr[iau]nk.*
- X parable.*
- X etc.
- X
- XNote that the pattern you specify must match words in their entirety.
- XFor instance
- X
- X sacrifice
- X
- Xwill only match "sacrifice." That is, it will cause Quranref to
- Xretrieve only those passages which contain the word "sacrifice." To
- Xcatch "sacrifices," "sacrificed," etc. you need to input a regular
- Xexpression which will match this string in full as well (e.g.
- X"sacrifice.*").
- X When you are done typing in a word or word-pattern, Quranref
- Xwill ask you if you are finished. If you are, then press the
- Xappropriate key ("f"), then hit a carriage return. In a couple of
- Xseconds, you should see a list of passages which contain the word or
- Xpattern which you specified (if in fact any such passages were found).
- XAlong with this list comes a new set of options, including ! (escape
- Xto a shell), a (append the current list to a file), b (back up), c
- X(clear and redraw screen), m (view next screen), and several others.
- XTry the various options out and see what they do. Two commands not
- Xlisted in the prompt string (which has to be of finite length!) are
- X"?" and "/." With some differences, these do pretty much what UNIX
- Xusers expect. If, say, you have a passage list containing 2000 hits,
- Xand you want to find the section where references from the chapter
- X"Women" begin, then type in "/4:" (traditionally, this chapter is
- Xnumber 4; "4:" will match everything from 4:1 on).
- X While viewing a passage here, or at the top level, you may
- Xjump to an arbitrary location by typing in a reference (e.g. "4:5").
- XYou may also move to the next passage in the text (+), or move to the
- Xprevious one (-). Finally, you may also either write (w) or append
- X(a) the current passage to a file. Again, try out the various
- Xoptions. When you are done, type "q" and press return. You will be
- Xbrought back to the previous menu, where you can *v*iew another
- Xpassage, or quit.
- X At the main menu, you can invoke several additional functions
- Xbeyond retrieving specific passages or passage lists. Quranref keeps
- Xa resume of all passage lists you have retrieved, storing it in a
- Xglobally accessible structure. You can look at this structure by
- Xtyping "l" (for "list") at the main menu prompt. From the resulting
- Xdisplay menu, you can then *v*iew any of your previous passage lists
- X(i.e. "hit lists" resulting from invocation of the *f*ind function).
- XWhen you are done, you can once again press "q"+return, and go back to
- Xthe top-level command loop.
- X From most of the display menus you can write or append
- Xpassages or passage lists to files. If at any time you wish to reread
- Xsuch files back into Quranref, type "r" at the main command prompt.
- XYou will then be prompted for a filename. If the file you name has
- Xnot been corrupted somehow, and is in the right format, Quranref will
- Xread it in and display it just the way it would the results of a
- X*f*ind operation.
- X A final basic function I'd like to mention here is Quranref's
- Xfacility for manual display of passage lists. As was mentioned a few
- Xparagraphs before, all your passage lists are all kept in memory, and
- Xyou can view the list of available ones by typing "l" at the main
- Xprompt. I'd just like to point out that if this seems too cumbersome,
- Xyou can simply type "d" and return. Quranref will retrieve and
- X*d*isplay the last passage list you created.
- X One somewhat under-tested aspect of Quranref's search facility
- Xis its ability to handle ranges and Boolean operators in search
- Xspecifications. You can, for instance, execute a *f*ind, using a
- Xpattern such as "unbelieve.*". When asked if you are finished, you
- Xcan then respond, not with the normal "f," but rather with an "a" (for
- SHAR_EOF
- true || echo 'restore of README failed'
- fi
- echo 'End of part 7'
- echo 'File README is continued in part 8'
- echo 8 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-