Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bryanpaget/d567979915fc5dd6a1095bbdb1e5cdc2 to your computer and use it in GitHub Desktop.

Select an option

Save bryanpaget/d567979915fc5dd6a1095bbdb1e5cdc2 to your computer and use it in GitHub Desktop.
Road Attribute Search Key (RASK) Specifications

Road Attribute Search Key

(RASK) Specifications

March 1, 2013
Corrections March 25/2014

Address Register Project Social Survey Methods Division

Daniel Chenier Belinda Ha Minnie Lee Michael Mayda

Changes (since previous version dated October 26, 2012)

Frozen copy of RASK created circa March 1, 2013, plus correction to errors in spec 36. No programming changes were needed as source code was correct.

Spec 29 rewritten to no longer change PR to PK. No programming changes were needed as the C and SAS versions were already not doing this.

Spec 29 rewritten to no longer change LK to LINK if found in STREET_NAME. No programming changes were needed as the C and SAS versions were already not doing this.

Spec 28.5: no parsing of plurals is necessary,. In particular, several pieces of code that will never be used were removed. Added BROOKE to subword list, added new head-parse exceptions: BROOKE from BROOK, MONT from MONTEE, POINT from POINTE, added new tail-parse exceptions: ALLEY from VALLEY, WAY from BYWAY, HI from HIWAY, removed tail-parse exception:WAY from PRKWAY. No programming changes were needed as the C and SAS versions were already programmed this way.

Spec 29 Added SR as search term in STREET_TYPE_ONLY Restricted the following search terms to STREET_TYPE_ONLY: AC, BF, BP, CW, CX, DS, EV, XY, HW,LG, LW, LP, PD, RS, RY, SD, SP, TW, TK,TU. No programming changes were needed as the C and SAS versions were already programmed this way.

Spec 29 – clarified that rules were order dependent changed order of several rules. Added new terms: DR WAY, DRV WAY for DR, EXPRESS for EXPY, HI WAY for HWY, THRU WAY, THROUGH WAY for THRUWY, RD WAY for ROADWY, PRK WAY for PKWY Removed redundant rules: CROSS ROAD for CRSSRD, SD ROAD, SIDE ROAD for SIDERD, PKWY for PKWY C code and SAS code need to be fixed

Spec 30 removed from specs – it has not been a requirement since 2010. No programming changes were needed as the C and SAS versions were already not doing this.

Spec 32.1 renamed to Spec 25. Minimum length requirement increased to 4. No programming changes were needed as the C and SAS versions were already programmed this way.

Spec 32.2 renamed to Spec 26. No programming changes were needed as the C and SAS versions were already programmed this way.

Spec 32.3 renamed to Spec 27. No programming changes were needed as the C and SAS versions were already programmed this way.

Spec 38 added terms FT, MUN, REG, TWP, CTY to second IF condition. No programming changes were needed as the C and SAS versions were already programmed this way.

Spec 42 – clarified order of removals. C code needs to be fixed

Documentation improvement – in addition to the word document, separate text files are now provided for specs 26, 29, 31, 35 and Appendix A.

Spec 28.5 was disabled March 25/14 to better suit Census service environment

Input: STREET_NAME, STREET_TYPE, STREET_DIR, PROV (can be PRCODE or PROVABVN)

Output: STREET_NAME_KEY, STREET_TYPE_KEY, STREET_DIR_KEY, STREET_NAME_KEY_NO_ARTICLES

Notes:

  1. "<>" means not equals

  2. "word" means a sequence of non-blank characters where the first character is either the start of the entire string or is preceded by a space, and the last character is either the end of the entire string or has a space after it (i.e. "This,/is's(2) words"). In other words, words are space delimited.

  3. In the examples, shown as comments throughout the document, the expected results pertain only to the portion of the algorithm being specified, not to the whole routine. Other specs may subsequently change other aspects of the input data.

  4. The specifications are order dependent.

Specification 1 Initialize STREET_NAME_KEY, STREET_TYPE_KEY, STREET_DIR_KEY to copies of corresponding input data such that they are left-justified, upcased and accents removed. Also replace the character Æ with A Note: Accented characters are the following: ÁÂÀÄÅÃ Ç ÉÊÈË ÍÎÌÏ Ñ ÓÔÒÖÕ ÚÛÙÜ Ý

Specification 3 /* Remove non-alphanumeric characters from STREET_TYPE_KEY and STREET_DIR_KEY / FOR each character in STREET_TYPE_KEY and STREET_DIR_KEY IF character is not alphanumeric (0-9 or A-Z) then remove it END-FOR / e.g. S T. => ST */

Specification 4 Replace, with a single space, everything from STREET_NAME_KEY in between and including the first open round bracket "(" and the last closed round bracket ")", as long as it doesn't remove everything from STREET_NAME_KEY /* e.g. one (two) three (four) five => one five / / (ONE) (WAY) => (ONE) (WAY) / / one (two (three) four) five => one five / / (DO NOT REMOVE => (DO NOT REMOVE / / DO NOT) REMOVE => DO NOT) REMOVE / / DO (NOT (REMOVE) THIS => DO THIS / / DO (NOT (REMOVE)) THIS) => DO */

Specification 6 /* Process special characters / / Note: after this spec, references to apostrophe/single quote mean ASCII symbol 39 / FOR each letter in STREET_NAME_KEY IF letter is ASCII 34 (" – quotation mark), ASCII 96 (` - grave accent), ASCII 180 (´ - acute accent), ASCII 145 (‘ – left single quotation mark), ASCII 146 (’ – right single quotation mark), ASCII 147 (“ – left double quotation mark) or ASCII 148 (” – right double quotation mark) or ASCII 166 (¦ – broken bar) replace letter with an apostrophe (ASCII 39) ELSE-IF letter is the single character ½ replace letter with "HALF" ELSE-IF letter not (alpha numeric (0-9, A-Z) or a space or a single quote (ASCII 39)) replace letter with END-IF END-FOR / e.g. 1½ "IS ½ AFTER FIRST" => 1HALF 'IS HALF AFTER FIRST' */

Specification 7.1 replace any multiple single quotes with one single quote /* e.g. L'''AUTOROUTE => L'AUTOROUTE / / '''XYZ => 'XYZ / / XYZ''' => XYZ' */

Specification 7.2 IF STREET_NAME_KEY contains a single quote at the end of any word IF next word after the single quote = "S" remove all spaces between the single quote and the "S" END-IF END-IF /* e.g. ' S XYZ => 'S XYZ / / SMITH' S SON => SMITH'S SON / / SMITH' SON => SMITH' SON */

Specification 7.3 IF any word in STREET_NAME_KEY begins with a single quote "'" and the previous word is the single letter D, L, or O then /* equivalently, if the word D, L or O exists, / / followed by a word starting with a quote / remove the space between the quote and the letter END-IF / e.g. DE L 'ORIGINAL => DE L'ORIGINAL / / O 'CONNOR => O'CONNOR / / D 'OH => D'OH / / DEL 'ETE => DEL 'ETE */

Specification 8 remove all interior blanks from STREET_DIR_KEY

Specification 9 remove all interior blanks from STREET_TYPE_KEY

Specification 10 Remove all of the following words from STREET_NAME_KEY unless the result is an empty string: "ET", "AND", "THE", "OF", "TO", "AN" /* e.g. TO THE TOP => TOP / / TO THE => TO THE (if the result would be empty after removing all the specified words, do nothing */

Specification 11 If the following words on the left are found anywhere in STREET_NAME_KEY, they should be replaced by the words on the right FORT => FT SAINTE, STE, SAINTES, SAINTS, STES, STS => SAINT SAITN => SAINT 0LD => OLD MUNICIPAL, MUNIC, MUNICIPALITY, MUNICIPALITE => MUN REGIONAL, RGNL, REGION => REG TOWNSHIP, TWNSHP, TWSP => TWP COUNTY, CNTY, COMTE => CTY STATION, STA => STN DIVISION, DIVISIONAL, DIVN => DIV CK => CREEK GLDN => GOLDEN LK => LAKE LWR => LOWER NDR => DR N PORTG => PORTAGE PR => PRINCE RIV => RIVER SDR => DR S UPR => UPPER VLY => VALLEY 'D' => D 'L' => L 'O' => O Note: For the last three cases above, we are looking for the word composed of , specified letter,

Specification 14 IF any words in STREET_NAME_KEY start with "MAC" replace "MAC" with "MC" END-IF /* e.g. MAC MAC MACDONALD MAC => MC MC MCDONALD MC */

Specification 15.1 IF any word in STREET_NAME_KEY begins with a single quote then remove the quote /* e.g. 'A' => A' / / WHAT ' IS THIS => WHAT IS THIS / / 'S => S / / ' => */

Specification 15.2 While any word in STREET_NAME_KEY ends in 'S, remove the 'S /* e.g HESS'S => HESS / / SMITH'S'S => SMITH / / This must be done recursively, as the second example shows */

Specification 15.3 Remove all single quotes from STREET_NAME_KEY unless the quote is preceded by the letter L, D or O /* e.g. SMITH' => SMITH / / DE L' EST => DE L' EST / / HERO' => HERO' / / HOLD'EM => HOLD'EM / / PICK'EM => PICKEM */

Specification 18 IF any of (L', O', D') begin any word in STREET_NAME_KEY: IF the character after the quote is not a space: place a space between the single quote and the rest of the word END-IF END-IF /* this ensures that the article and quote become their own separate word, if / / they were not already. If they were already separate, this spec does nothing / / e.g. D'ARCY => D' ARCY / / D' ARCY => D' ARCY */

Specification 20 /* Patterns like 13 TH, 2 ND should be compressed into 1 word / FOR any word that is a number in STREET_NAME_KEY IF the next word is in ("IERE","IEME","ERE","EME","IER","IME","E","RE","ER") remove the spaces between the number and the next word ELSE-IF the number ends with an "11", "12", or "13" and the next word is "TH" remove the spaces between the number and "TH" ELSE-IF then number ends with a "2" and the next word is "ND" remove the spaces between the number and "ND" ELSE-IF the number ends with a "4","5","6","7","8","9","0" and the next word is "TH" remove the spaces between the number and "TH" END-IF END-FOR / cannot do 3 RD, since that might mean road */

Specification 21 /1st, 2nd, 1er etc./ FOR all words in STREET_NAME_KEY that start with a number followed by a sequence of characters IF characters in ("IERE","IEME","ERE","EME","IER","ER","RE","E","TH","ST","ND","RD","IME") remove characters END-IF END-FOR /* e.g. 43RD => 43 / / 1ST => 1 */

Specification 22.1 /* Remove leading zeros from any type of word / FOR all words in STREET_NAME_KEY IF word starts with one or more zeros remove leading zeros END-IF END-FOR

  • leading zeros are defined as the largest set of 0s that can be found at the beginning of a word that is followed immediately by a numeric (0-9)

/* e.g. 0 => 0 not a leading 0 since no numeric follows / / 0A => 0A not a leading 0 since no numeric follows / / 10001 => 10001 not leading 0s since not at beginning of the word / / 00 => 0 the first 0 is leading since it starts the word, / / the second is not since it is not followed by a numeric / / 000 => 0 the first two 0s are leading since they start the word, / / the third is not since it is not followed by a numeric / / EXIT001 099 => EXIT001 99 shows that not all leading Os, as we might want to / / define them are actually removed (i.e. EXIT001 / / stays the same because the 0s do not start the word). / / We acknowledge this minor limitation */

Specification 25 /* drop final s, when not final double s / FOR each word in STREET_NAME_KEY IF word ends with S and not SS and length of the word is >= 4 then remove final S from word END-IF END-FOR / e.g. LESS ESS SS S IS ITS MORES THEESSS => LESS ESS SS S LESS IS IT MORE THEESSS */

Specification 26 /* Convert spelled numbers to numerals. Note: "and" and "et" already removed */ Starting from the left, check STREET_NAME_KEY for the following words or sets of words and replace the word or words on the left with the number on the right. The strings to search for should be checked in the order given. Note that we first look for four word combinations, then three word combinations, then doubles, then single words. The list includes some deliberate misspellings which might be encountered in practice. Also note that the conversion of "PREMIER(E)" to "1" is performed only in the provinces of Québec and New Brunswick.

See RASK_specs_yyyymmdd_spec26_table.txt and RASK_specs_yyyymmdd_spec26_PREMIER(E)_exception.txt for a text file implementation.

/* four word – French */ QUATRE VINGT DIX NEUVIEME => 99 QUATRE VINGT DIX NEUF => 99 QUATRE VINGT DIX HUITIEME => 98 QUATRE VINGT DIX HUIT => 98 QUATRE VINGT DIX SEPTIEME => 97 QUATRE VINGT DIX SEPT => 97

/* three word French */ QUATRE VINGT SEIZIEME => 96 QUATRE VINGT SEIZE => 96 QUATRE VINGT QUINZIEME => 95 QUATRE VINGT QUINZE => 95 QUATRE VINGT QUATORZIEME => 94 QUATRE VINGT QUATORZE => 94 QUATRE VINGT TREIZIEME => 93 QUATRE VINGT TREIZE => 93 QUATRE VINGT DOUZIEME => 92 QUATRE VINGT DOUZE => 92 QUATRE VINGT ONZIEME => 91 QUATRE VINGT ONZE => 91 QUATRE VINGT DIXIEME => 90 QUATRE VINGT DIX => 90 QUATRE VINGT NEUVIEME => 89 QUATRE VINGT NEUF => 89 QUATRE VINGT HUITIEME => 88 QUATRE VINGT HUIT => 88 QUATRE VINGT SEPTIEME => 87 QUATRE VINGT SEPT => 87 QUATRE VINGT SIXIEME => 86 QUATRE VINGT SIX => 86 QUATRE VINGT CINQUIEME => 85 QUATRE VINGT CINQ => 85 QUATRE VINGT QUATRIEME => 84 QUATRE VINGT QUATRE => 84 QUATRE VINGT TROIZIEME => 83 QUATRE VINGT TROISIEME => 83 QUATRE VINGT TROIS => 83 QUATRE VINGT TROI => 83 QUATRE VINGT DEUXIEME => 82 QUATRE VINGT DEUX => 82 QUATRE VINGT UNIEME => 81 QUATRE VINGT UNE => 81 QUATRE VINGT UN => 81 SOIXANTE DIX NEUVIEME => 79 SOIXANTE DIX NEUF => 79 SOIXANTE DIX HUITIEME => 78 SOIXANTE DIX HUIT => 78 SOIXANTE DIX SEPTIEME => 77 SOIXANTE DIX SEPT => 77

/* two word French */ NEUF MILLE => 9000 HUIT MILLE => 8000 SEPT MILLE => 7000 SIX MILLE => 6000 CINQ MILLE => 5000 QUATRE MILLE => 4000 TROIS MILLE => 3000 TROI MILLE => 3000 DEUX MILLE => 2000 UN MILLE => 1000

NEUF CENTS => 900 NEUF CENT => 900 HUIT CENTS => 800 HUIT CENT => 800 SEPT CENTS => 700 SEPT CENT => 700 SIX CENTS => 600 SIX CENT => 600 CINQ CENTS => 500 CINQ CENT => 500 QUATRE CENTS => 400 QUATRE CENT => 400 TROIS CENTS => 300 TROI CENTS => 300 TROIS CENT => 300 TROI CENT => 300 DEUX CENTS => 200 DEUX CENT => 200

UN CENT => 100

UN CENTIEME => 100

QUATRE VINGTIEME => 80 QUATRE VINGT => 80

SOIXANTE SEIZIEME => 76 SOIXANTE SEIZE => 76 SOIXANTE QUINZIEME => 75 SOIXANTE QUINZE => 75 SOIXANTE QUATORZIEME => 74 SOIXANTE QUATORZE => 74 SOIXANTE TREIZIEME => 73 SOIXANTE TREIZE => 73 SOIXANTE DOUZIEME => 72 SOIXANTE DOUZE => 72 SOIXANTE ONZIEME => 71 SOIXANTE ONZE => 71 SOIXANTE DIXIEME => 70 SOIXANTE DIX => 70

SOIXANTE NEUVIEME => 69 SOIXANTE NEUF => 69 SOIXANTE HUITIEME => 68 SOIXANTE HUIT => 68 SOIXANTE SEPTIEME => 67 SOIXANTE SEPT => 67 SOIXANTE SIXIEME => 66 SOIXANTE SIX => 66 SOIXANTE CINQUIEME => 65 SOIXANTE CINQ => 65 SOIXANTE QUATRIEME => 64 SOIXANTE QUATRE => 64 SOIXANTE TROIZIEME => 63 SOIXANTE TROISIEME => 63 SOIXANTE TROIS => 63 SOIXANTE TROI => 63 SOIXANTE DEUXIEME => 62 SOIXANTE DEUX => 62 SOIXANTE UNIEME => 61 SOIXANTE UNE => 61 SOIXANTE UN => 61

CINQUANTE NEUVIEME => 59 CINQUANTE NEUF => 59 CINQUANTE HUITIEME => 58 CINQUANTE HUIT => 58 CINQUANTE SEPTIEME => 57 CINQUANTE SEPT => 57 CINQUANTE SIXIEME => 56 CINQUANTE SIX => 56 CINQUANTE CINQUIEME => 55 CINQUANTE CINQ => 55 CINQUANTE QUATRIEME => 54 CINQUANTE QUATRE => 54 CINQUANTE TROIZIEME => 53 CINQUANTE TROISIEME => 53 CINQUANTE TROIS => 53 CINQUANTE TROI => 53 CINQUANTE DEUXIEME => 52 CINQUANTE DEUX => 52 CINQUANTE UNIEME => 51 CINQUANTE UNE => 51 CINQUANTE UN => 51

QUARANTE NEUVIEME => 49 QUARANTE NEUF => 49 QUARANTE HUITIEME => 48 QUARANTE HUIT => 48 QUARANTE SEPTIEME => 47 QUARANTE SEPT => 47 QUARANTE SIXIEME => 46 QUARANTE SIX => 46 QUARANTE CINQUIEME => 45 QUARANTE CINQ => 45 QUARANTE QUATRIEME => 44 QUARANTE QUATRE => 44 QUARANTE TROIZIEME => 43 QUARANTE TROISIEME => 43 QUARANTE TROIS => 43 QUARANTE TROI => 43 QUARANTE DEUXIEME => 42 QUARANTE DEUX => 42 QUARANTE UNIEME => 41 QUARANTE UNE => 41 QUARANTE UN => 41

TRENTE NEUVIEME => 39 TRENTE NEUF => 39 TRENTE HUITIEME => 38 TRENTE HUIT => 38 TRENTE SEPTIEME => 37 TRENTE SEPT => 37 TRENTE SIXIEME => 36 TRENTE SIX => 36 TRENTE CINQUIEME => 35 TRENTE CINQ => 35 TRENTE QUATRIEME => 34 TRENTE QUATRE => 34 TRENTE TROIZIEME => 33 TRENTE TROISIEME => 33 TRENTE TROIS => 33 TRENTE TROI => 33 TRENTE DEUXIEME => 32 TRENTE DEUX => 32 TRENTE UNIEME => 31 TRENTE UNE => 31 TRENTE UN => 31

VINGT NEUVIEME => 29 VINGT NEUF => 29 VINGT HUITIEME => 28 VINGT HUIT => 28 VINGT SEPTIEME => 27 VINGT SEPT => 27 VINGT SIXIEME => 26 VINGT SIX => 26 VINGT CINQUIEME => 25 VINGT CINQ => 25 VINGT QUATRIEME => 24 VINGT QUATRE => 24 VINGT TROIZIEME => 23 VINGT TROISIEME => 23 VINGT TROIS => 23 VINGT TROI => 23 VINGT DEUXIEME => 22 VINGT DEUX => 22 VINGT UNIEME => 21 VINGT UNE => 21 VINGT UN => 21

DIX NEUVIEME => 19 DIX NEUF => 19 DIX HUITIEME => 18 DIX HUIT => 18 DIX SEPTIEME => 17 DIX SEPT => 17

/* two word English */ NINE THOUSAND => 9000 EIGHT THOUSAND => 8000 SEVEN THOUSAND => 7000 SIX THOUSAND => 6000 FIVE THOUSAND => 5000 FOUR THOUSAND => 4000 THREE THOUSAND => 3000 TWO THOUSAND => 2000 ONE THOUSAND => 1000

ONE THOUSANDTH => 1000

NINE HUNDRED => 900 EIGHT HUNDRED => 800 SEVEN HUNDRED => 700 SIX HUNDRED => 600 FIVE HUNDRED => 500 FOUR HUNDRED => 400 THREE HUNDRED => 200 TWO HUNDRED => 200 ONE HUNDRED => 100

ONE HUNDREDTH => 100

NINETY NINTH, NINETY NINETH => 99 NINETY NINE => 99 NINETY EIGHTH => 98 NINETY EIGHT => 98 NINETY SEVENTH => 97 NINETY SEVEN => 97 NINETY SIXTH => 96 NINETY SIX => 96 NINETY FIFTH => 95 NINETY FIVE => 95 NINETY FOURTH => 94 NINETY FOUR => 94 NINETY THIRD => 93 NINETY THREE => 93 NINETY SECOND => 92 NINETY TWO => 92 NINETY FIRST => 91 NINETY ONE => 91

EIGHTY NINTH, EIGHTY NINETH => 89 EIGHTY NINE => 89 EIGHTY EIGHTH => 88 EIGHTY EIGHT => 88 EIGHTY SEVENTH => 87 EIGHTY SEVEN => 87 EIGHTY SIXTH => 86 EIGHTY SIX => 86 EIGHTY FIFTH => 85 EIGHTY FIVE => 85 EIGHTY FOURTH => 84 EIGHTY FOUR => 84 EIGHTY THIRD => 83 EIGHTY THREE => 83 EIGHTY SECOND => 82 EIGHTY TWO => 82 EIGHTY FIRST => 81 EIGHTY ONE => 81

SEVENTY NINTH, SEVENTY NINETH => 79 SEVENTY NINE => 79 SEVENTY EIGHTH => 78 SEVENTY EIGHT => 78 SEVENTY SEVENTH => 77 SEVENTY SEVEN => 77 SEVENTY SIXTH => 76 SEVENTY SIX => 76 SEVENTY FIFTH => 75 SEVENTY FIVE => 75 SEVENTY FOURTH => 74 SEVENTY FOUTH => 74 SEVENTY THIRD => 73 SEVENTY THREE => 73 SEVENTY SECOND => 72 SEVENTY TWO => 72 SEVENTY FIRST => 71 SEVENTY ONE => 71

SIXTY NINTH, SIXTY NINETH => 69 SIXTY NINE => 69 SIXTY EIGHTH => 68 SIXTY EIGHT => 68 SIXTY SEVENTH => 67 SIXTY SEVEN => 67 SIXTY SIXTH => 66 SIXTY SIX => 66 SIXTY FIFTH => 65 SIXTY FIVE => 65 SIXTY FOURTH => 64 SIXTY FOUR => 64 SIXTY THIRD => 63 SIXTY THREE => 63 SIXTY SECOND => 62 SIXTY TWO => 62 SIXTY FIRST => 61 SIXTY ONE => 61

FIFTY NINTH, FIFTY NINETH => 59 FIFTY NINE => 59 FIFTY EIGHTH => 58 FIFTY EIGHT => 58 FIFTY SEVENTH => 57 FIFTY SEVEN => 57 FIFTY SIXTH => 56 FIFTY SIX => 56 FIFTY FIFTH => 55 FIFTY FIVE => 55 FIFTY FOURTH => 54 FIFTY FOUR => 54 FIFTY THIRD => 53 FIFTY THREE => 53 FIFTY SECOND => 52 FIFTY TWO => 52 FIFTY FIRST => 51 FIFTY ONE => 51

FORTY NINTH, FORTY NINETH => 49 FORTY NINE => 49 FORTY EIGHTH => 48 FORTY EIGHT => 48 FORTY SEVENTH => 47 FORTY SEVEN => 47 FORTY SIXTH => 46 FORTY SIX => 46 FORTY FIFTH => 45 FORTY FIVE => 45 FORTY FOURTH => 44 FORTY FOUR => 44 FORTY THIRD => 43 FORTY THREE => 43 FORTY SECOND => 42 FORTY TWO => 42 FORTY FIRST => 41 FORTY ONE => 41

THIRTY NINTH, THIRTY NINETH => 39 THIRTY NINE => 39 THIRTY EIGHTH => 38 THIRTY EIGHT => 38 THIRTY SEVENTH => 37 THIRTY SEVEN => 37 THIRTY SIXTH => 36 THIRTY SIX => 36 THIRTY FIFTH => 35 THIRTY FIVE => 35 THIRTY FOURTH => 34 THIRTY FOUR => 34 THIRTY THIRD => 33 THIRTY THRER => 33 THIRTY SECOND => 32 THIRTY TWO => 32 THIRTY FIRST => 31 THIRTY ONE => 31

TWENTY NINTH, TWENTY NINETH => 29 TWENTY NINE => 29 TWENTY EIGHTH => 28 TWENTY EIGHY => 28 TWENTY SEVENTH => 27 TWENTY SEVEN => 27 TWENTY SIXTH => 26 TWENTY SIX => 26 TWENTY FIFTH => 25 TWENTY FIVE => 25 TWENTY FOURTH => 24 TWENTY FOUR => 24 TWENTY THIRD => 23 TWENTY THREE => 23 TWENTY SECOND => 22 TWENTY TWO => 22 TWENTY FIRST => 21 TWENTY ONE => 21

/* one word French */ MILLE => 1000 CENTIEME => 100 CENT => 100

SOIXANTIEME => 60 SOIXANTE => 60 CINQUANTIEM => 50 CINQUANTE => 50 QUARANTIEME => 40 QUARANTE => 40 TRENTIEME => 30 TRENTE => 30 VINGTIEME => 20 VINGT => 20

SEIZIEME => 16 SEIZE => 16 QUINZIEME => 15 QUINZE => 15 QUATORZIEME => 14 QUATORZE => 14 TREIZIEME => 13 TREIZE => 13 DOUZIEME => 12 DOUZE => 12 ONZIEME => 11 ONZE => 11 DIXIEME => 10 DIX => 10

NEUVIEME => 9 NEUF => 9 HUITIEME => 8 HUIT => 8 SEPTIEME => 7 SEPT => 7 SIXIEME => 6 SIX => 6 CINQUIEME => 5 CINQ => 5 QUATRIEME => 4 QUATRE => 4 TROIZIEME => 3 TROISIEME => 3 TROIS => 3 TROI => 3 DEUXIEME => 2 DEUX => 2 UNIEME => 1 UNE => 1 UN => 1

IF PROV in ("13","24","NB","QC") PREMIERE => 1 PREMIER => 1 ELSE no changes

/* One word English */ THOUSANDTH => 1000 THOUSAND => 1000 HUNDREDTH => 100 HUNDRED => 100 NINETIETH => 90 NINETY => 90 EIGHTIETH => 80 EIGHTY => 80 SEVENTIETH => 70 SEVENTY => 70 SIXTIETH => 60 SIXTY => 60 FIFTIETH => 50 FIFTY => 50 FORTIETH => 40 FORTY => 40 THIRTIETH => 30 THIRTY => 30 TWENTIETH => 20 TWENTY => 20

NINETEENTH => 19 NINETEEN => 19 EIGHTEENTH => 18 EIGHTEEN => 18 SEVENTEENTH => 17 SEVENTEEN => 17 SIXTEENTH => 16 SIXTEEN => 15 FIFTEENTH => 15 FIFTEEN => 15 FOURTEENTH => 14 FOURTEEN => 14 THIRTEENTH => 13 THIRTEEN => 13 TWELFTH => 12 TWELVE => 12 ELEVENTH => 11 ELEVEN => 11

TENTH => 10 TEN => 10 NINTH, NINETH => 9 NINE => 9 EIGHTH => 8 EIGHT => 8 SEVENTH => 7 SEVEN => 7 SIXTH => 6 SIX => 6 FIFTH => 5 FIVE => 5 FOURTH => 4 FOUR => 4 THIRD => 3 THREE => 3 SECOND => 2 TWO => 2 FIRST => 1 ONE => 1

/* Roman numerals II - XXX, excluding single letters V and X */

XXX => 30

XXIX => 29 XXVIII => 28 XXVII => 27 XXVI => 26 XXV => 25 XXIV => 24 XXIII => 23 XXII => 22 XXI => 21 XX => 20

XIX => 19 XVIII => 18 XVII => 17 XVI => 16 XV => 15 XIV => 14 XIII => 13 XII => 12 XI => 11

IX => 9 VIII => 8 VII => 7 VI => 6 IV => 4 IIII => 4 III => 3 II => 2

Specification 27 WHILE STREET_NAME_KEY contains the word "NO" or "NOS" and the next word is a numeral or a numeral followed by a single letter Remove the word "NO" or "NOS" END-WHILE

Specification 28 /* We want to keep SAINT and STREET separate / IF first word in STREET_NAME_KEY is "ST" and STREET_NAME_KEY contains more than 1 word replace first word with "SAINT" END-IF / e.g. ST LOUIS => SAINT LOUIS */

Specification 28.5

THIS SPEC HAS BEEN DISABLED FOR THIS VERSION!!!!!!!!!!!!

/* parse compound words */ Given SUBWORD_LIST, for each word in STREET_NAME_KEY, parse out any "subword" found at the beginning of the word and any "subword", or its plural, found at the end of the word, provided the remaining string has a minimum length of 3.

SUBWORD_LIST: ABBEY ACRE ALLEY BAY BEACH BEND BLOCK BROOK BROOKE CAPE CENTER CENTRE CHASE CLOSE CORNER COURT COVE CRESCENT CREST CROSS CROSSING DALE DELL DOWN DRIVE END FARM FIELD FOREST FRONT GARDEN GATE GLADE GLEN GREEN GROUND GROVE HARBOR HARBOUR HAVEN HEIGHT HIGH HILL KNOLL LAND LANE LINE MALL MANOR MEADOW MONT MOOR MOUNT ORCHARD PARC PARK PASSAGE PATH PEAK PINE PLACE PLAZA POINT POINTE PORT RANGE RIDGE RISE ROAD SQUARE TOWER TRAIL VALE VIEW VISTA
WALK WAY WOOD

For simplicity, assume that the plural of a subword is formed by adding "S" to the end of it. (i.e., "ES" plurals like "BEACHES" are not being considered.) Note that since the plural of the subword is not being parsed from the beginning of the word, Unusual results can occur (see "PORTSMOUTH" example below).

Do not head-parse the following compound words:

• BROOK: BROOKE • CROSS: CROSSING, CROSSROAD • DRIVE: DRIVEWAY • HIGH : HIGHLAND, HIGHWAY • LAND : LANDING • LANE : LANEWAY • MONT : MONTAGNE, MONTEE • MOUNT: MOUNTAIN • PARK : PARKWAY • PATH : PATHWAY • POINT: POINTE • ROAD : ROADWAY

Do not tail-parse the following compound words: • ALLEY: VALLEY • GREEN: EVERGREEN • LAND : HIGHLAND, ISLAND • LINE : TOWNLINE, COLLINE • POINT: RONDPOINT • ROAD : CROSSROAD, SIDEROAD • WAY : BYWAY, CAUSEWAY, DRIVEWAY, EXPRESSWAY, FREEWAY, HIWAY, HIGHWAY, LANEWAY, PARKWAY, PATHWAY, PRKWAY, ROADWAY, THROUGHWAY, THRUWAY

FOR each word in STREET_NAME_KEY FOR each subword in SUBWORD_LIST IF the word has not already been "head-parsed" THEN IF the word begins with the singular of one of the subwords in SUBWORD_LIST and the rest of the word has length >= 3 THEN Insert a space after the found subword END-IF END-IF IF the word has not already been "tail-parsed" THEN IF the word ends with the singular of one of the subwords in SUBWORD_LIST and the rest of the word has length >= 3 THEN Insert a space before the found subword ELSE-IF the word ends with the plural of one of the subwords in SUBWORD_LIST and the rest of the word has length >= 3 THEN Insert a space before the found subword Delete the plural "S" END-IF END-IF END-FOR END-FOR

/* e.g., / / DISNEYLAND --> DISNEY LAND simple example / / HYLAND --> HYLAND do not parse since "HY" is too short / / DISNEYLANDS --> DISNEY LAND strip the "S" after tail-parsing plurals / / PORTSMOUTH --> PORT SMOUTH do not strip the "S" when head-parsing plurals / / HILLSONCREST --> HILL SON CREST double parsing (head & tail) */

Specification 29 Unless noted otherwise, FOR STREET_TYPE_KEY and all words in STREET_NAME_KEY, the following words or consecutive word pairs on the left should be converted to the words on the right.

See RASK_specs_yyyymmdd_spec29_table.txt, RASK_specs_yyyymmdd_spec29_RNG_exception.txt and RASK_specs_yyyymmdd_spec29_table_sttype_only.txt for a text file implementation.

"CH","CHEM","CHEMIN","RAOD","ROAD".........................................=> "RD" "WY","VOIE" . => "WAY" "BY PASS" (must be done before PASS=>BAY) => "BYPASS" "DROIT PASS","DROIT PASSAGE" (must be done before PASS=>BAY) => "DRPASS" "DRIVE WAY" (must be done before DRIVE=>DR) => "DR" "HIGH WAY" (must be done before HIGH=>HTS) => "HWY" "EXPR WAY" (must be done before EXPR=>EXPY) => "EXPY"

"ABBY" => "ABBEY" "AC"*,"ACER","ACERS","ACRE", => "ACRES" "AL","ALLEE","ALLY" => "ALLEY" "AVE","AVENUE","AVENEUE" => "AV"

"BA","BAIE","PASS","PASSAGE","PS","PSG" => "BAY" "BCH" => "BEACH" "BN","BND" => "BEND" "BLK","BLOC" => "BLOCK" "BF","BLUF" => "BLUFF" "BD","BL","BLD","BLV","BOUL","BOULE","BOULEV","BOULEVARD","BOULV", "BV","BVD" => "BLVD" "BOURGE" => "BOURG" "BARRAGE" => "BRGE" "BRK","BROOKE" => "BROOK" "BP","BYPS","BYP" => "BYPASS" "BWY","BY WAY" => "BYWAY"

"CAMPU" => "CAMPUS" "CARRE" => "CAR" "CARREFOUR","CAREFOUR" => "CARREF" "CAUSEWAY","CW"* => "CAUSWY" "CD","CUL DE SAC","CUL SAC",CULSAC" => "CDS" "CE","CER","CERC","CERCL","CERCLE","CI","CIRC","CIRCL","CIRCLE", "CIRL","CIRLE","CIRS","CRCL","CRCLE","CRI","CRICL" => "CIR" "CIRCUIT","CRCT" => "CIRCT" "CL","CLOVE","CLS","CS" => "CLOSE" "CM","CMMN","CMN","COM","COMM","COMMN","COMMO" => "COMMON" "CN","CON","CONCESION","CONCESS","CONCESSION","CONCESSIONS" => "CONC" "CV" => "COVE" "CR","CRE","CREES","CREL","CRESC","CRESCENT","CREST","CROI", "CROIS","CROISSANT", "CRESANT","CRESCANT","CRESENT","CRESE","CRESL","CRS","CRSCNT","GRES"* => "CRES" "CORNER","CORNERS","CRNR" => "CRNRS" "CROSSING","CRSS","CX"* => "CROSS" "CROSROAD","CROSS RD","CROSS ROAD","CROSSRD","CROSSROAD","X RD","XRD" => "CRSSRD" "COURT","CRTS","CT" => "CRT" "C"*,"CENTER","CENTRE => "CTR"

"DESSERTE" => "DESSTE" "DIVER","DIVERSION" => "DIVERS" "DOWN","DS"*,"DWN","DWNS" => "DOWNS" "DRIVE WAY","DRV WAY","DR WAY","DDR","DIRVE","DRIEV","DRIVE","DRIVEWAY","DROVE","DRV", "PM", "PROM","PROMENADE","SRIVE" => "DR"

"ECHANGEUR" => "ECH" "ESPLANADE" => "ESPL" "ESTAT","ESTATES","ESTS" => "ESTATE" "EV","EVERGREEN" => "EVERGN" "EX" => "EXIT" "EXPR WAY","EXPRESS","EXPR","EXPRESS WAY","EXPRESSWAY","EXPRESWAY", "EXPW","XY" => "EXPY" "EXT","EXTENTION","EXTENSION","EXTN" => "EXTEN"

"FRNT" => "FRONT" "FREE WAY","FREEWAY","FRWY" => "FWY"

"GT" => "GATE" "GARDE","GARDEN","GARDENS","GDN","GN","GRDN","GRDNS","GS" => "GDNS" "GLN" => "GLEN" "GR","GRN" => "GREEN" "GND","GNDS","GRND","GROUND","GROUNDS" => "GRNDS" "BOIS","GV" => "GROVE"

"HAR","HARBOR","HARBOUR","HARBUR","HB","HBR","HRBR" => "HARBR" "HGHLD","HIGH LAND","HIGH LANDS","HIGHLAND","HIGHLANDS", "HIGHLND","HIGHLNDS" => "HGHLDS" "HILLS","HL" => "HILL" "HOLOW","HW"* => "HOLLOW" "HEIGH","HEIGHT","HEIGHTS","HGHT","HGHTS","HGT","HGTS","HIGH","HIGT", "HIGTS","HT","HTG","HTGS","PLAT","PLATEAU","PLATEAUX","PLT","PU" => "HTS" "AUT","AUTO ROUTE","AUTOROUTE","HGWY","HIGHWA", "HIGHWAY","HI WAY","HIWAY","HY",HYW","PROVINCIAL TRUNK","ROUTE","RT","RTE" => "HWY"

"ILE","ILES","ISL","ISLANDS","ISLD","ISLDS","ISLE","ISLES","I"* => "ISLAND" "IMPASSE" => "IMP"

"KNL" => "KNOLL"

"LANDG","LANDI","LANDING","LD","LDG","LDN",LDNG","LG","LNDG",LNDNG" => "LANDNG" "LANET","LLANE","LN","RL","RLE","RUELLE" => "LANE" "LANE WAY","LANEWAY" => "LANEWY" "LW" => "LAWN" "LI" => "LINE" "LK*","LNK" => "LINK" "LOOK OUT","LOOKOUT" => "LKOUT" "LIMIT","LIMITS","LMT" => "LMTS" "LP"* => "LOOP"

"MAN","MNR","MOR","MR" => "MANOR" "MDW","MDWS" => "MEADOW" "ME","MEW" => "MEWS" "MO","MTE","MTEE" => "MONTEE" "MONT","MONTAGNE","MONTAIN","MONTAINE","MOUNT","MOUNTAIN","MT" => "MTN"

"ORCHARD" => "ORCH"

"PTH" => "PATH" "PINE" => "PINES" "PRK WAY","PARK WAY","PARKW","PARKWAY","PAW","PKW","PKWAY","PKWY","PKY", "PRKW","PRKWA","PRKWAY","PRKWY","PRKY","PY" => "PKWY" "PA","PARC","PARK","PRK" => "PK" "PLACE","PLC" => "PL" "PLZ","PLZA","PZ" => "PLAZA" "PD"* => "POND" "PNT","POIN","POINT","POINTE" => "PT" "PATH WAY","PATHWAY","PATHWY","PTHWAY","PTHWY" => "PTWAY" "PRIV","PRIVATE","PRIVE","PRT","PRVT","PRVTE" => "PVT"

"QUAI" => "QUAY"

"RNG"** => "RANG" "CH","CHEM","CHEMIN","RAOD","ROAD" => "RD" "RD PT","ROND POINT","ROND PT","RONDPOINT","RONDPT" => "RDPT" "RANGE","RGE","RNG"**,"RNGE" => "RG" "COTE","RDE","RDG","RDGE","RDQ","RI","RIDG","RIGDE" => "RIDGE" "RS"* => "RISE" "RY"*,"RDWY","RD WAY" => "ROADWY" "RW" => "ROW" "RIGHT OF WAY","RIGHT WAY" => "RTOFWY" "RUI","RUISSEAU" => "RUIS" ** In Quebec(QC or 24), change RNG to RANG; otherwise change it to RG

"SEC","SECT","SECTION" => "SECTN" "SENTIER" => "SENT" "SD"* => "SIDE" "SD RD","SD RO","SD ROAD","SDRD","SDRO","SDROAD", "SIDE RD","SIDE RO","SIDE ROAD","SIDERO","SIDEROAD",”SR”* => "SIDERD" "SQR","SQRE","SQUAR","SQUARE","SQURE" => "SQ" "RU","RUE","RUER","STR","STREE","STREET" => "ST" "SP"* => "STRIP" "STL" => "STROLL" "SUB DIV","SUBD","SUBDIVISION" => "SUBDIV"

"TC","TCE","TE","TER","TERRA","TERRACE","TERRASSE","TERRC","TERRE","TSSE" => "TERR" "THICKET" => "THICK" "THROUGH WAY","THROUGHWAY","THRU WAY","THRUWAY","TW"* => "THRUWY" "TOWNL","TOWN LINE","TOWNLINE" => "TLINE" "TK"* => "TOOK" "TOWER","TWR","TWRS" => "TOWERS" "TAIL","TARIL","TL","TR","TRI","TRIAL","TRL" => "TRAIL" "TURN ABOUT","TURNABOUT" => "TRNABT" "TU" => "TURN" "TURNPIKE", "TURN PIKE" => "TURNPK"

"VILLA" => "VILLAS" "VW" => "VIEW" "VILLAGE" => "VILLGE"

"COUR","COURS","WK" => "WALK" "WY","VOIE" => "WAY" "WF" => "WHARF" "WD","WOODS" => "WOOD" "WINDE" => "WYND"

END-FOR (STREET_TYPE_KEY and all words in STREET_NAME_KEY)

  • the following terms are changed when they occur in STREET_TYPE_KEY, but NOT when they occur in STREET_NAME_KEY: AC, BF, BP, CW, GRES, CX, C, DS, EV, XY, HW, I, LG, LW, LK, LP, PD, RS, RY, SD, SR, SP, TW, TK, TAIL, TU

Specification 29.5 /* move SIDE and CROSS from street name to street type under certain circumstances / IF the last word of STREET_NAME_KEY is "SIDE" and it is not the only word and STREET_TYPE_KEY is "RD" THEN Remove SIDE from STREET_NAME_KEY STREET_TYPE_KEY = "SIDERD" END-IF IF the last word of STREET_NAME_KEY is "CROSS" and it is not the only word and STREET_TYPE_KEY is "RD" THEN Remove CROSS from STREET_NAME_KEY STREET_TYPE_KEY = "CRSSRD" END-IF / e.g. "GALENA SIDE", "RD" => "GALENA", "SIDERD" / / "BISHOP CROSS", "RD" => "BISHOP", "CRSSRD" */

/Specification 30 was removed/

Specification 31 /* Standardize spelled out street directions in street name / / Note: There may be one or more spaces between words / / e.g. NORTH WEST => NW / / NORTH EAST WEST => NE WEST */ FOR all words in STREET_NAME_KEY, the following words or consecutive word pairs on the left should be converted to the words on the right

See RASK_specs_yyyymmdd_spec31_table.txt for a text file implementation.

"SUD O" => "SW" "NORD O" => "NW" "NORTHERN","NORD" => "NORTH" "EASTERN","EST" => "EAST" "SOUTHERN","SUD" => "SOUTH" "WESTERN","OUEST" => "WEST" "NORDOUEST","NORTHWESTERN","NORTHWEST","NORTH W","NO","NORTH WEST","N W","N O" => "NW" "NORDEST","NORTHEASTERN","NORTHEAST","NORTH E","NORTH EAST","N E" => "NE" "SUDEST","SOUTHEASTERN","SOUTHEAST","SOUTH E","SOUTH EAST","S E" => "SE" "SUDOUEST","SOUTHWESTERN",SOUTHWEST","SOUTH W","SO","SOUTH WEST","S W","S O" => "SW" END-FOR

This page deliberately left blank

Specification 32 /* Misplaced type edit / IF province is not Quebec FOR each word in STREET_NAME_KEY, starting with the last word IF word is not the only word in STREET_NAME_KEY IF word = STREET_TYPE_KEY remove word from STREET_NAME_KEY ELSE-IF STREET_TYPE_KEY is blank and word is a valid street type key (i.e. found on the list of valid types in Appendix A) STREET_TYPE_KEY = word erase word from STREET_NAME_KEY END-IF END-IF END-FOR / The following examples denote street name and type as <STREET_NAME>|<STREET_TYPE> / / e.g. BIG ST ST ST | => BIG | ST / / BIG ST | ST => BIG | ST / / MAIN ST | => MAIN | ST / / AV IRIS RD | => AV IRIS | RD */

ELSE /* Province is Quebec / FOR each word in STREET_NAME_KEY, starting with the first word IF word is not the only word in STREET_NAME_KEY IF word = STREET_TYPE_KEY remove word from STREET_NAME_KEY ELSE-IF STREET_TYPE_KEY is blank and word is a valid street type key (i.e found on the list of valid types in Appendix A) STREET_TYPE_KEY = word erase word from STREET_NAME_KEY END-IF END-IF END-FOR END-IF / The following example denotes street name and type as <STREET_NAME>|<STREET_TYPE> / / e.g. AV IRIS RD | => IRIS RD | AV */

Specification 33 replace all words "SAINT" in STREET_NAME_KEY with "ST"

Specification 35 The following words on the left, appearing in STREET_DIR_KEY, should be converted to the words on the right:

See RASK_specs_yyyymmdd_spec35_table.txt for a text file implementation.

"NORTHERN","NORD","NORTH" => "N" "EASTERN","EST","EAST" => "E" "SOUTHERN","SUD","SOUTH" => "S" "WESTERN","OUEST","WEST","O" => "W" "NORDOUEST","NORTHWESTERN","NORTHWEST","NO","NORDO","NORTHW" => "NW" "NORDEST","NORTHEASTERN","NORTHEAST","NORDE","NORTHE" => "NE" "SUDEST","SOUTHEASTERN","SOUTHEAST","SUDE","SOUTHE" => "SE" "SUDOUEST","SOUTHWESTERN",SOUTHWEST","SO","SUDO","SOUTHW" => "SW"

Specification 36 /* misplaced direction edit NOTE: currently does not do anything if,for example, word = WEST and dir = N or S. we might want to add cases like this some day*/ FOR each word in STREET_NAME_KEY, starting with the last word IF word is not the only word (more than 1 word in STREET_NAME_KEY) IF word in ("NORTH","N") & STREET_DIR_KEY in (" ","N") then STREET_DIR_KEY = "N" remove word from STREET_NAME_KEY END-IF ELSE-IF word in ("SOUTH","S") & STREET_DIR_KEY in (" ","S") then STREET_DIR_KEY = "S" remove word from STREET_NAME_KEY END-IF ELSE-IF word in ("EAST","E") & STREET_DIR_KEY in (" ","E") then STREET_DIR_KEY = "E" remove word from STREET_NAME_KEY END-IF ELSE-IF word in ("WEST","W",","O") & STREET_DIR_KEY in (" ","W") then STREET_DIR_KEY = "W" remove word from STREET_NAME_KEY END-IF ELSE-IF word in ("NORTH","N","SOUTH","S") and STREET_DIR_KEY in ("E","W") then STREET_DIR_KEY = substr(word,1,1)||STREET_DIR_KEY remove word from STREET_NAME_KEY END-IF ELSE-IF word in ("E","W") and STREET_DIR_KEY in ("N","S") then STREET_DIR_KEY = trim(STREET_DIR_KEY)||trim(word) remove word from STREET_NAME_KEY END-IF ELSE-IF word = "O" and STREET_DIR_KEY in ("N","S") then STREET_DIR_KEY = trim(STREET_DIR_KEY)||"W"; remove word from STREET_NAME_KEY END-IF ELSE-IF word ="NW" & STREET_DIR_KEY in (" ","NW") then STREET_DIR_KEY = "NW" remove word from STREET_NAME_KEY END-IF ELSE-IF word ="NE" & STREET_DIR_KEY in (" ","NE") then STREET_DIR_KEY = "NE" remove word from STREET_NAME_KEY END-IF ELSE-IF word ="SW" & STREET_DIR_KEY in (" ","SW") then STREET_DIR_KEY = "SW" remove word from STREET_NAME_KEY END-IF ELSE-IF word ="SE" & STREET_DIR_KEY in (" ","SE") then STREET_DIR_KEY = "SE" remove word from STREET_NAME_KEY END-IF END-IF (word is not the only word) END-FOR Examples for Specification 36 STREET_NAME |STREET_DIR MAIN WEST | => MAIN | W
MAIN WEST | W => MAIN | W
E N MAIN NORTH MAIN | => MAIN MAIN | NE

Specification 37 FOR any two digits separated by a blank, insert the word 'AND' between them END-FOR /* e.g. 100 1 => 100 AND 1 / / NE23 22 2E1 => NE23 AND 22 AND 2E1 */

Specification 38 /* invert numeric plus CONC, etc. / IF word1 in STREET_NAME_KEY is a number or a number plus a single letter IF word2 in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") and word3 is not (a number or a number plus a single letter) and not in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") STREET_NAME_KEY = word2 + word1 + rest of STREET_NAME_KEY / e.g. 6 CONC COLCHESTER => CONC 6 COLCHESTER */

ELSE-IF word2 in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") and word3 in("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") and word4 is not (a number or a number plus a single letter) and not in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") STREET_NAME_KEY = word2 + word3 + word1 + rest of STREET_NAME_KEY /* e.g. 4 BASELINE MUN COLCHESTER => BASELINE MUN 4 COLCHESTER */

ELSE-IF word2 = "AND" and word3 is (a number or number plus a single letter) and word4 in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") and word5 is not (a number or a number plus a single letter) and not in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") STREET_NAME_KEY = word4 + word1 + word2 + word3 + rest of STREET_NAME_KEY /* e.g. 100 AND 200 RG COLCHESTER => RG 100 AND 200 COLCHESTER */

ELSE-IF word2 = "AND" and word3 is a (number or a number + a single letter) and word4 in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG", TWP","CTY") and word5 in ("CONC","DIV","LINE","BASE","BASELINE","RG","FT","MUN","REG","TWP","CTY") STREET_NAME_KEY = word4 + word5 + word1 + word2 + word3 + rest of STREET_NAME_KEY /* e.g. 3 AND 4 BASELINE MUN COLCHESTER => BASELINE MUN 3 AND 4 COLCHESTER */ END-IF END-IF Note: This specification is a bit stupid. For example, a case like: "1A and 3 CONC Colchester" cannot occur, since the "and" would have been removed, and not replaced (because 1A is not a number. Oh well, maybe someday will take another look at it.

Specification 38.2 FOR any two adjacent numbers insert the word 'AND' between them END-FOR /* e.g. 100 1 => 100 AND 1 / / required again, since spec 38 can bring two numbers side by side / / that were not previously side by side */

Specification 41 create new variable, called STREET_NAME_KEY_NO_ARTICLES and set it equal to STREET_NAME_KEY

Specification 42 remove the following consecutive word pairs from STREET_NAME_KEY_NO_ARTICLES: "A L'","A LA" After removing above, remove the following words from STREET_NAME_KEY_NO_ARTICLES: ,"DE","DES","DU","LA","LE","LES","AUX","AU","L'","O'","D'"

Specification 43 IF STREET_NAME_KEY_NO_ARTICLES is empty set STREET_NAME_KEY_NO_ARTICLES=STREET_NAME_KEY /* e.g. STREET_NAME_KEY = DE LA RIVIERE => STREET_NAME_KEY_NO_ARTICLES = RIVIERE / / STREET_NAME_KEY = DE L' => STREET_NAME_KEY_NO_ARTICLES = DE L' / / Note: in example above, the single quote will be removed in a later step. We left / / it in, for the example, just to show the effect on specification 43 by itself */

Specification 44 remove all single quotes from STREET_NAME_KEY remove all single quotes from STREET_NAME_KEY_NO_ARTICLES

Specification 45 /* Compress street name key */ remove all interior spaces in STREET_NAME_KEY and left-justify remove all interior spaces in STREET_NAME_KEY_NO_ARTICLES and left-justify

END-CREATE_SEARCH_KEY

Appendix A: Valid street type keys

See RASK_specs_yyyymmdd_appendixA_table.txt for a text file implementation.

ABBEY ACCESS* ACRES AIRE* ALLEY AV

BAY BEACH BEND BLOCK* BLUFF** BLVD BOURG* BRGE* BROOK* BYPASS BYWAY

CAMPUS CAPE CAR CARREF CAUSWY** CDS CHASE CIR CIRCT CLOSE COMMON CONC COVE CRES CRNRS CROFT* CROSS CRSSRD* CRT CTR

DALE DELL DESSTE* DIVERS DOWNS DR DRPASS*

ECH END ESPL ESTATE EVERGN** EXIT** EXPY EXTEN

FARM FIELD FOREST FRONT FSR* FWY

GATE GDNS GLADE GLEN GREEN GRNDS GROVE

HARBR HAVEN* HEATH HGHLDS HILL HOLLOW HTS HWY

IMP INLET ISLAND

KEY KNOLL

LANDNG LANE LANEWY* LAWN** LINE LINK LKOUT LMTS LOOP

MALL MANOR MAZE MEADOW MEWS MONTEE MOOR MTN

ORCH

PARADE PATH PEAK* PINES PK PKWY PL PLAZA POND** PORT PT PTWAY PVT

QUAY

RAMP RANG RD RDPT REACH* RG RIDGE RISE ROADWY** ROW RTOFWY* RUIS* RUN

SECTN* SENT SIDE** SIDERD* SQ ST STRIP** STROLL* STUB SUBDIV

TERR THICK THRUWY** TLINE TOOK** TOWERS TRACE* TRAIL TRNABT TRUNK* TURN** TURNPK**

VALE VIA VIEW VILLAS VILLGE VISTA

WALK WAY WHARF WOOD WYND

For Information Only:

  • These are street types designated by NGD; they are not recognized by CPC. ** These are street types designated by PEI; they are not recognized by CPC.

For Information Only: Some terms in use by CPC and/or EC may not appear in the list above because RASK uses one of the following equivalents instead (rationale in brackets):

ALLEE = ALLEY (Authors) AUT = HWY (Authors) AVE = AV (CPC) BAIE = BAY (Authors) BLOC = BLOCK (Authors) BOIS = GROVE (Ottawa) BOUL = BLVD (CPC) C = CTR (CPC) CERCLE = CIR (Ottawa) CH = RD (Ottawa) CREST = CRES (Authors) (NGD considers CREST a type) CROIS = CRES (Ottawa) COTE = RIDGE (Ottawa) COUR = CRT (Ottawa) COURS = WALK (Ottawa) DRWY = DR (Ottawa) ILE = ISLAND (Authors) MOUNT = MTN (Authors) PARC = PK (Authors) PASS = BAY (Ottawa) PLACE = PL (CPC) PLAT = HTS (Ottawa) POINTE = PT (Authors) PROM = DR (Ottawa) RTE (ROUTE) = HWY (Authors) (NGD considers both RTE and ROUTE as separate types) RUE = ST (CPC) RLE (RUELLE)= LANE (Ottawa)
TSSE = TERR (Ottawa) VOIE = WAY (Ottawa) QUAI = QUAY (Authors)

Source of Ottawa translations (retrieved 20080923): http://www.ottawa.ca/residents/bylaw/a_z/municipal_addressing_en.html Note PKY and DR are the same according to Ottawa, but we ignored that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment