Referencing dictionary fields from another rule set
You can use the dictionary fields of one rule set in another rule set. You might want to reference other rule sets to create a test case that helps you determine which patterns to use.
The reference syntax is as follows: {<DictionaryFieldName>
OF <RuleSetName>}.
Within the Standardize stage, you can check the conditions and actions from dictionary fields of a previously processed rule set and determine if a different set of actions is required for the same pattern within the current rule set. You must ensure that both the referenced rule set and referencing rule set are specified in the same Standardize stage. Ensure that the referenced rule set precedes the referencing rule set in the stage properties list of rule sets. For example, if USADDR references USAREA, then the USAREA rule set must proceed USADDR in the list of rule sets in the Properties window of the Standardize stage.
The two rule sets domains, area and address, can provide more examples. Address is processed independently of the area. In this example, you check to see if the CAAREA rule set generates Quebec as the associated province. If Quebec is the Canadian province then you want CAADDR to handle the address differently than the way address patterns are handled for other Canadian provinces.
You reference the CAAREA dictionary fields in the CAADDR rule set. In the Standardize stage, you ensure that CAAREA is defined and listed before CAADDR.
In CAADDR.PAT file, the pattern checks to see
the contents of the dictionary field, ProvinceAbbreviation
of CAAREA is QC. The following patterns
show how you can create the reference in CAADDR:
^ | T | ? | $ [ {ProvinceAbbreviation OF CAAREA} ="QC" ]
COPY [1] {CivicNumber}
COPY_A [2] {StreetSuffixType}
COPY_S [3] {StreetName}
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETURNThe preceding pattern specifies that, in the province of Quebec, the street type (as defined in CAADDR.CLS and represented by T), moves to StreetSuffixType, for ease of matching.
^ | T | ? | $
COPY [1] {CivicNumber}
COPY_A [2] {StreetPrefixType}
COPY_S [3] {StreetName}
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
RETURNA Canadian street address might be: 498 Rue Bordeaux. The output from the rule sets would be as follows:
| CAAREA | CivicNumber | StreetPrefixType | StreetName | StreetSuffixType |
|---|---|---|---|---|
| Quebec | 498 | Bordeaux | Rue | |
| Other Canadian provinces | 498 | Rue | Bordeaux |