I have parsed the following address:
12-13 1/3 A B One Blvd
using the following code:
COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY [7] temp2
CONCAT " " temp2
CONCAT [8] temp2
CONCAT " " temp2
CONCAT [9] temp2
COPY temp2 {SN}
COPY [10] {ST}
CALL Address_Type
EXIT
successfully using PAL. However, I would like some help in parsing all similar addresses. For example, if I have the following addresses:
12-13 1/3 A B One Blvd
14-15 1/2 D Two Blvd
16-17 1/2 Three Blvd
I would like to write one set of code to parse all of these addresses. What I mean is, I might have one or more text tokens between the house number and street type.
I would appreciate any help/hint/comment in this regard.
Parsing a complex address
This is what you should do, one set code for all you address examples
^ | - | ^ | ^ | / | ^ | ** | T =A= "BLVD" | $
COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY_S [7] temp2
CONCAT temp2 {SN}
COPY [8] {ST}
CALL Address_Type
EXIT
^ | - | ^ | ^ | / | ^ | ** | T =A= "BLVD" | $
COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY_S [7] temp2
CONCAT temp2 {SN}
COPY [8] {ST}
CALL Address_Type
EXIT
small change in code
This is what you should do, one set code for all you address examples
^ | - | ^ | ^ | / | ^ | ** | T =A= "BLVD" | $
COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY_S [7] {SN}
COPY [8] {ST}
CALL Address_Type
EXIT
This is what you should do, one set code for all you address examples
^ | - | ^ | ^ | / | ^ | ** | T =A= "BLVD" | $
COPY [1] temp
CONCAT [2] temp
CONCAT [3] temp
CONCAT " " temp
CONCAT [4] temp
CONCAT [5] temp
CONCAT [6] temp
COPY temp {HN}
COPY_S [7] {SN}
COPY [8] {ST}
CALL Address_Type
EXIT