28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. Country codes are standardized to enable a comparison of different codes for the same country, for example,<br />

'D-', 'DE-' and 'DEU-' for German postcodes. All unknown/invalid country codes are standardized to one<br />

special 'dummy' country code.<br />

3. Spaces and dashes are removed from the remaining postcode.<br />

4. All letters are standardized to uppercase.<br />

User Input Country Code Remaining Postcode<br />

71691 71691<br />

716 91 71691<br />

D-71691 D 71691<br />

DE-71 691 DE 71691<br />

D 71691 D71691<br />

Germany-71691 GERMANY71691<br />

GB-A1H 2ZU GB A1H2ZU<br />

A1H-2ZU A1H2ZU<br />

gb-A1h 2zu GB A1H2ZU<br />

XY-12345 XX 12345<br />

zz-12345 XX 12345<br />

AI-2640 AI 2640<br />

The last example is the only known example where the country code is part of the postcode (AI = Anguilla). The<br />

algorithm works here as well, as the country code is also compared. The two examples directly above the AI<br />

example show invalid country codes. Both are standardized to the same non-existent 'dummy' country code.<br />

Postcode Comparison<br />

The standardized postcodes are compared using a variation of the fuzzy string comparison. This variation gives a<br />

higher weight to the first two characters of the postcode.<br />

Country codes are given the same weight as a single character at the end of the postcode.<br />

● Only postcodes with the same country code can get a score of 1.0.<br />

● If one country code is given and the second country code is empty, the score of the postcode comparison is<br />

less than 1.0.<br />

● If both country codes are given and are different, the score of the postcode comparison is also less than 1.0.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Enabling Search<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 277

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!