comparing name matching names algorithm
Posted on 2000-05-11
This algorithm considered 2 surnames in each were compared on a character-for-character basis. the following figure1 summarises the nine rules or tests used for matching the letters of two surnames; note that they all depended on the position of the letters in the names, their sequence or order, rather than on what the letters themselves were.
figure1 tests for position of letters in matching alternate surname spellings
position in Name 1 position ion Name 2
test1 x x
test2 x x+1
test3 x x+2
test4 x x-1
test5 x-1 x
test6 x+1 x
test7 x+2 x
test8 x+1 x+1
test9 x+2 x+2
the first step in the algorithm(not shown in figure 1) was a check for identical names, looking at ech of the surnames as a single character string. Failing that, tyhe algorithm entered the loop shown in figure 1 and compared the two surnames letter by letter, considering each turn. As long as the two nbames were identical, the algorithm succeeded with Test1 and did not drop down through the rest of the loop. When a mismatch occurred in the letter-for letter comparison, the remaining eight tests were tried in the order shown in figure 1. A success with any of the test caused the algorithm to return to the beginning of the loop, increment the counter by 1, check for the end of the name, and proceed to go through the loop again comparing the next letters in the two names.
and that's it...
any good codes offer will be considered as the high marks.