The phrase replacement process is similar to that performed by the Word Replace logic except that phrase replacement rules can detect and replace multiple words, initials, numbers or codes.
A phrase, and its replacement, each have a maximum length of 50 characters, and each word in a phrase or its replacement has a maximum length of 24 characters.
Both the phrase and its replacement can be one word; however, if both the phrase and its replacement are one word then theWord Replace rule would typically be used.
Phrase Replacement Logic
If a particular Phrase replacement rule is a sub-set of another Phrase replacement rule, and the last word in both rules is the same, the longest phrase definition which matches is used.
For example, if the Edit-List has the following Phrase definitions:
Phrase: SOFTWARE AMERICA
Replacement: XXX
Phrase: SEARCH SOFTWARE AMERICA
Replacement: YYY
then the name :
RESEARCH DIVISION SEARCH SOFTWARE AMERICA
would be produce the following result:
RESEARCH DIVISION YYY
because
SEARCH SOFTWARE AMERICA
is the longer match of the two entries.
Notice that no
XXX
replacement will ever take place in his case, because once the replacement is made and the name becomes
RESEARCH DIVISION YYY
, then
SOFTWARE AMERICA
no longer exists.
After the replacement, the resulting word or phrase is used in a re-lookup of the Edit-List to see if any other rules apply.
There are a number of reasons for defining Phrase Replacement rules.
Acronyms
It is recommended that in most cases the acronym is replaced with its long form. The reason is that there is a greater chance of error in the long form,
For example,
Phrase:IBM
Replacement: INTERNATIONAL BUSINESS MACHINES
Remember, when defining new Edit-List rules, try to make the rules complete to maximize the benefit. In the above example, it would also be important to define a Phrase Replacement rule for:
Phrase:I B M
Replacement: INTERNATIONAL BUSINESS MACHINES
Phrase:INTL BUSINESS MACHINES
Replacement: INTERNATIONAL BUSINESS MACHINES
It is not necessary to define a rule for I.B.M., as the full-stops are removed prior to Edit-List processing.
This example also provides an opportunity to discuss when one might want to use a single word in a phrase and replacement rule. For example, if the word INTERNATIONAL was needed in a number of phrase replacement rules, one can define it once as a single word, and it will be processed before the other rules. Thus defining,