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.

Use Case Fuzzy Search - House Numbers<br />

Score Calculation<br />

The house number comparison aims for a 'simple' solution that is easy to understand, gives good results, and<br />

works for most countries. The limitations of the algorithm are:<br />

● The algorithm focuses on numeric values - either a single number ('8') or a range of numbers ('8 - 12').<br />

● House number additions (for example, the 'a' in '8a') are either equal or not equal.<br />

When comparing two strings containing house numbers with each other, the score is calculated according to the<br />

rules described below.<br />

House number addition. A house number addition in terms of this backlog item is any additional text that is<br />

written before or after the numeric value of a house number.<br />

House number ranges. When a string contains at least two numbers and there is a dash between the first and<br />

second number, this is treated as a house number range. The first number is the lower bound of the range, the last<br />

number is the upper bound.<br />

Multiple numbers. When multiple numbers are part of a house number string that does not define a house<br />

number range, the first number is the house number used for the comparison. All remaining information is used<br />

as a house number addition.<br />

Whitespace characters. For all rules, whitespace characters are ignored when comparing the house numbers.<br />

For the score calculation it does not matter if a house number is given as '8a' or '8 a' or if it is '8-10' or '8 - 10'.<br />

Symmetry. In all examples, the score calculation is symmetric. This means that either string 1 or string 2 can be<br />

the user input and the other string is stored in the database table.<br />

Rule 1 - House Numbers or House Number Ranges Are Identical<br />

For identical house numbers, a score of 1.0 is returned. Identical house numbers are house number strings that<br />

are equal when whitespace characters are ignored.<br />

Examples:<br />

String 1 String 2 Score<br />

5 5 1.0<br />

5a 5 a 1.0<br />

8-12 8-12 1.0<br />

9 in the backyard 9 in the backyard 0.9<br />

272<br />

P U B L I C<br />

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

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

Enabling Search

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

Saved successfully!

Ooh no, something went wrong!