Browse Prior Art Database

Pattern-Matched String Translation

IP.com Disclosure Number: IPCOM000102405D
Original Publication Date: 1990-Nov-01
Included in the Prior Art Database: 2005-Mar-17
Document File: 2 page(s) / 62K

Publishing Venue

IBM

Related People

Talley, TM: AUTHOR

Abstract

REPHRASE is an exec which matches a passed string and returns a "translated" string to the caller. Provisions are made for variable substitution, multiple line responses, and instantiation of matching variables.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 76% of the total text.

Pattern-Matched String Translation

       REPHRASE is an exec which matches a passed string and
returns a "translated" string to the caller.  Provisions are made for
variable substitution, multiple line responses, and instantiation of
matching variables.

      REPHRASE matches patterns stored in a profile (see Fig. 1).
The calling program passes a string to be translated and, optionally,
the name of a profile.  REPHRASE matches the strings, perhaps using
variables to match portions of the input string, then translates the
string based upon the translation definition in the profile.  The
translation may span multiple lines and may include variables, which
may have been instituted from the matching process, or a priori in
the profile.  The translated message may be written to a file, typed
on the screen, or passed back to the calling routine.

      Some examples of REPHRASE, using the profile in Fig. 1, are
shown below.
Given:  Rephrase('A dog C')
Result: Matches "A b C" where "b" is dog. Did this work?
Given:  Rephrase('A B jack is D back F')
Result: Did this give "C E" = jack is back?
Given:  Rephrase('some other string')
Result: Match any line and repeat. some other string

      The matching algorithm, which is the key to the facility, is
performed using a combination of the  REXX "interpret" and "parse"
commands (see Fig. 2).  The matching algorithm determines whether  an
input string matches a specific template and also automatically
instant...