[mod.computers.vax] KWIC

SCHOMAKE@HNYKUN53.BITNET (10/22/86)

LEWIS%cs.umass.edu@CSNET-RELAY.ARPA wrote:

>      Does anyone know of a KWIC (Keyword In Context) indexing program
> that runs under VMS?  I would be interesting in hearing of one (preferably
> public domain) as well as of other programs useful in Information Retrieval
> research.

VMS V4 has an RTL STR$ routine STR$MATCH_WILD which you can use in a simple
main program. It gives you the same wildcarding options (*,%) as in
file specifications, e.g.

     IFOUND=STR$MATCH_WILD(string,'**foo %%%foo*')

Combined with LIB$GET_FOREIGN and LIB$FIND_FILE you can make something that
beats VMS SEARCH with respect to pattern specification:

        $ MY_KWIC *%%.*doc "*some*thing%."


Do
        $ HELP RTL LIB$ LIB$GET_FOREIGN
        $ HELP RTL LIB$ LIB$FIND_FILE
        $ HELP RTL STR$ STR$MATCH_WILD
                                         for more information.

If you look for a standard utility, UNIX's grep might be something for you.
Both grep and the proposed solution have the restriction that text patterns
cannot comprise more than a single line.


                 *
               ^^^^^
      KKKKKUUUUNNNNN
      KKK  UUUU NNNN           Lambert Schomaker
      K    UUUU  NNN           SCHOMAKER@HNYKUN53.BITNET
      KKK  UUUU   NN           Nijmegen, The Netherlands.
      KKKKK UU     N