home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / fileutil / infobase.arj / INFOBASE.DOC < prev   
Encoding:
Text File  |  1991-03-16  |  9.9 KB  |  216 lines

  1.  
  2. INFOBASE - Text file index & search by Keyword.
  3.  
  4. Shareware, by Steve Rackley, Copyright 1991.
  5.  
  6. Version 1.0, March 1991.
  7.  
  8. 1. Introduction.
  9.  
  10.    InfoBase is a system for searching text files which consist of a
  11.    number of sections, where each section is identified by a Keyword
  12.    header line. Only the keyword lines are scanned for the words being
  13.    searched for - the addresses of these lines are held in an index file,
  14.    which is used to give fast access to the keywords. This approach gives
  15.    a very small index file (4 bytes per text section), whilst still giving
  16.    a fairly fast search. This is a rather different approach from most
  17.    other programs of this type: generally they index every word in the file
  18.    except those excluded by the user. This gives an index file of about the
  19.    same size as the text file, and doesn't solve the most important problem:
  20.    the text section may not actually contain the word you want (Eg an item
  21.    about Telix may not include the word 'Comms'), and text may also include
  22.    words that don't have any significance (eg the word 'Comms' may be
  23.    mentioned in an item that is nothing to do with comms). Using the
  24.    'index every word' method and searching for all references to comms
  25.    programs may therefore omit some, while including some false references.
  26.    The only other method that I found was in a program that indexed the
  27.    text on keywords, but only allowed 1 set of keywords per file, forcing
  28.    the user to keep all the text items in separate files. InfoBase is an
  29.    attempt to get the best of both worlds.
  30.  
  31.    The system consists of 4 files: this doc file, a program to build the
  32.    index file (IBIX.EXE), the search program (IBASE.EXE) and a small sample
  33.    Information file (IBASE.TXT).
  34.  
  35.    InfoBase is Shareware - feel free to distribute it to others, provided
  36.    that no changes are made to the programs or documentation, but please
  37.    remember that it is NOT free software. If you find it useful, please
  38.    register your copy, by sending a small sum (ten pounds Sterling is
  39.    suggested) to:
  40.  
  41.        Steve Rackley,
  42.        17 Tichborne Close
  43.        Blackwater,
  44.        Camberley,
  45.        Surrey GU17 0JQ
  46.        UK.
  47.  
  48.    Registered users will receive the latest version free of charge, and
  49.    will be entitled to at least one free upgrade if later enhancements
  50.    are made.
  51.  
  52.  
  53. 2. Setting up your text files.
  54.  
  55.    I mainly use InfoBase to index and search a large file containing
  56.    messages filed by the Telepathy offline reader for CIX. After filing
  57.    the messages that I want to hold for later reference, I edit in the
  58.    keyword headers - one header for each message - and re-index the file. 
  59.    Another use for the system is to index on-disc technical reference works,
  60.    such as those listing DOS and BIOS functions. In this case a keyword
  61.    header should be added at the start of each relevant section, giving
  62.    words to identify the subjects mentioned in the section, eg disc, video
  63.    etc. The best point is that you may have several files like this from
  64.    various different sources - by merging them all into a single file
  65.    you can greatly simplify the process of searching for information on
  66.    various functions.
  67.  
  68.    All you need to do to make the file suitable for InfoBase is the
  69.    following:
  70.  
  71.    a. Identify the 'sections' that you want to split the file into, eg
  72.       chapters and sections of an on-disc document, or individual messages
  73.       filed from a conferencing system or bulletin board.
  74.  
  75.    b. Using a text editor, at the start of each section insert a line
  76.       beginning '@@@KEY@@@ ', and containing any words relevant to the
  77.       section. For example, a filed message about writing Telix scripts
  78.       might be given the keywords 'Telix', 'Comms', and 'Script'. In that
  79.       case the full header line would read:
  80.  
  81.       @@@KEY@@@ telix comms script
  82.  
  83.       IBASE.EXE can be instructed to find multiple words using 'And' or 'Or'
  84.       combinations, so the above line would be found by searching for 'Telix',
  85.       'Telix or Comms', 'Telix and Script', and so on.
  86.  
  87.       HINT: Don't use plurals. 'Game' and 'Games', for example, are two
  88.       different words as far as InfoBase is concerned, so if you put 'game'
  89.       in the header then search for 'games', or vice-versa, you won't find 
  90.       much. If you make it a rule to never use plurals in headers or on
  91.       the search line, you won't have this problem.
  92.  
  93.    c. Run IBIX.EXE to build the index file, or just run IBASE.EXE - this will
  94.       ask you if you want to re-index, if it does not find a valid index 
  95.       file.
  96.  
  97. 3. Using InfoBase.
  98.  
  99.    The command-line for IBASE.EXE is: ibase <text-file-name>.
  100.    The program will look for an index file with the same name as the text
  101.    file but an extension of .IBX.
  102.  
  103.    If an index file is not found, or if it is out of date (new items added
  104.    to the end of the text file, or the last index entry doesn't point to a
  105.    @@@KEY@@@ line because the text file has been edited), you will be asked
  106.    if you want to re-index the file. Replying Y will call IBIX.EXE to carry
  107.    out the re-index, and then continue. Replying N will abandon the program.
  108.  
  109.    IBIX can also be run separately to force a re-index. The command line
  110.    is much the same: ibix <text-file-name>.
  111.  
  112.    You will then be prompted for a search string. To find a single word,
  113.    just enter that word. To find text sections with all of several words
  114.    in their headers, enter 'word1 word2 word3' etc. You may explicitly
  115.    put '&' characters between the words (word1 & word2, etc), but this isn't
  116.    essential - AND is the default. To find sections with one or more of
  117.    several words in their headers, you must use the '|' character between
  118.    the words, ie 'word1 | word2 | word3'.
  119.  
  120.    Each time a matching header is found, its following section will be 
  121.    displayed. If it is more than a screenful, a 'More...' prompt will be
  122.    given after each screenful - press any key to carry on. At the end of
  123.    each section, you will be prompted to press ESC to stop the search, or
  124.    any other key to look for another matching header.
  125.  
  126.    Output may be redirected to a file by ending the Search String line with
  127.    '>filename' (to open a new file, overwriting any existing one of the
  128.    same name), or '>>filename' (to append the text to an existing file, or
  129.    create the file if it doesn't exist).
  130.  
  131.    Examples:
  132.  
  133.    telix & script              Display any sections whose keywords include
  134.                                the words 'telix' and 'script'.
  135.  
  136.    telix script                Exactly the same as above - the '&' is 
  137.                                optional.
  138.  
  139.    telix | comms >commfile     Find any sections whose keywords include the
  140.                                words 'telix' OR 'comms', and copy them to a
  141.                                file called 'commfile'. This file will always
  142.                                be re-created, destroying any existing copy.
  143.  
  144.    procomm >>commfile          Find any sections whose keywords include the
  145.                                word 'procomm', and copy them to a file called
  146.                                'commfile'. They will be added to the end of
  147.                                the file if it already exists, otherwise the
  148.                                file will be created.
  149.  
  150.  
  151. 4. Features and restrictions.
  152.  
  153.    All searches are case-independent, ie 'FRED', 'Fred' and 'fred' are all
  154.    considered to be identical.
  155.  
  156.    Up to 10 words can be specified on the search line. (Excluding &/| 
  157.    characters and the optional output file).
  158.  
  159.    The maximum length of a word is 15 characters.
  160.  
  161.    AND and OR conditions cannot be combined in the search line at present.
  162.  
  163.    There is no limit to the number of words on a @@@KEY@@@ line, but the
  164.    total length of the line is currently limited to 127 characters.
  165.  
  166.    There is no limit to the number of @@@KEY@@@ lines in a file, or to the
  167.    file size.
  168.  
  169.    @@@KEY@@@ lines are copied with the text when an output file is specified,
  170.    so the resulting file is suitable for indexing as a new InfoBase file.
  171.  
  172. 5. Performance.
  173.    Some people may be discouraged by the fact that the text file must be
  174.    re-indexed whenever it is changed, or by the fact that only the keyword
  175.    header addresses are indexed. Don't be, unless your file is huge or
  176.    your machine is very slow! InfoBase was tested on a 25Mhz 486 with a
  177.    16ms ESDI drive, and on an 8Mhz 286 with a 28Ms MFM drive.
  178.    The file used was almost 457K, and contained 265 sections, with an
  179.    average of four keywords per section.
  180.  
  181.    Results:
  182.    Reindex file: 486: 3 seconds    286: 24 seconds
  183.  
  184.    Search entire file for non-existent keyword:
  185.                  486: 2 seconds    286: 6 seconds
  186.  
  187.  
  188.  
  189. 6. Future plans.
  190.  
  191.    If a few people register InfoBase I may improve it. The obvious thing to
  192.    do first is to add the ability to append new files to the main file, and
  193.    to insert and edit the keyword lines, thus doing away with the need for
  194.    a separate text editor. In fact I'll probably do this if feedback
  195.    suggests that a few people are using InfoBase, whether or not I get any
  196.    registrations.
  197.  
  198.    I may also change the indexing method if some people find the access too
  199.    slow, though I don't think this will be necessary unless some really huge
  200.    files are used: 6 seconds to go through 265 sections on an average-speed
  201.    machine isn't too bad. The alternative is to store the actual keywords in
  202.    the index file, which will give a much bigger file and is unlikely to
  203.    improve the search times all that much.
  204.  
  205.    Something else I'm considering is the addition of multiple search
  206.    conditions, with bracketed expressions, eg:
  207.    (fred & bill) | joe.
  208.  
  209.    Further suggestions are welcome, and please report any bugs or problems,
  210.    including documentation errors/omissions.
  211.  
  212.    I can be contacted by snail-mail at the address given in the introduction,
  213.    or as srackley@cix.compulink.co.uk
  214.  
  215.  
  216.