Standardising multiple word states into state abreviations

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
jneasy
Participant
Posts: 32
Joined: Sun Jan 29, 2012 8:47 pm
Location: Australia

Standardising multiple word states into state abreviations

Post by jneasy »

Hi,

I have an address field I would like to standardise. the problem I have is I cant seem to perform a classification override for a mulitple words, for example I would like to standardise the words NEW SOUTH WALES to the abreviation of NSW.

First off opening the existing AUAREA rule set and trying to perform classification override does not allow for the space character in the input token.

I have also tried taking a copy of the AUAREA rule set and modifying the classification table by inserting a new classification of:
"NEW SOUTH WALES" NSW S

Any help on this issues would be appreciated.

Cheers,
Joseph.
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

Hi Joseph,

You can do this by creating a reference table out of them and add a Pattern/Action Block in the PAT file.
It's explained on page 32 of the Pattern Action Reference.
jneasy
Participant
Posts: 32
Joined: Sun Jan 29, 2012 8:47 pm
Location: Australia

Post by jneasy »

Ok so I have created a reference table named AUSTATES and entered in the following rows for a start:
"NEW SOUTH WALES" NSW
"SOUTH AUSTRALIA" SA


Now I'm a bit stuck with editing the Pattern file, is this the correct pattern to convert the words to their abreviated form?
&
CONVERT [1] @AUSTATES.TBL TKN

Also I am unsure where I would need to add this pattern. I am using a copy of the AUAREA rule set if this helps.
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

Just had another look and I don't think my earlier post will work.
You'll probably have to do it the manual way, eg

& = "NEW" | & = "SOUTH" | & = "WALES"
RETYPE [1] S "NSW"
RETYPE [2] 0
RETYPE [3] 0

Do that sort of thing for each state.

IIRC there is a call to a Common_Patterns subroutine:

&
CALL Common_Patterns

It would probably be easiest to put it above this.
Post Reply