Finding closest Match

Hello All,

I need to find the closest match given an array.

The array may not be sorted.

If the search string "abcd" and the results array is {"abc", "abce", "abx"}, we should have the result sorted as {"abc", "abx" and "abce"}. At the same time, I need to highlight the record "abc" since it is the closest match.

I had posted this query in March as well but in that case the database came to my rescue. This is not the case now.

Currently, I am using CollationIterators and comparing charecter by charecter but this does not seem to be a great way

Could someone suggest a better approach.

Thanx a lot in anticipation

Jeetendra

[691 byte] By [jeetendradassani] at [2007-9-26 3:47:14]
# 1
You could use the LevenShtein Distance for the problem have a look at: http://www.merriampark.com/ld.htm
StreichertF at 2007-6-29 12:29:39 > top of Java-index,Desktop,I18N...