0

Can anybody help with selecting of algorithm.

To compare two strings and give a relevance percentage(if more left found, more rank). maybe merge two algorithms for example: looking for "chocolate white quills" we have records

CHOCOLATE, WHITE/DARK QUILLS [MONA LISA, 4 #/CS]
CHOCOLATE, WHITE QUILLS [SWISS CHALET, 900 GR BOX]
PASTRY INGR., CHOCOLATE QUILLS WHITE [SWISS CHALET FINE FO, 16 / 120 CT]

the result must be like this:

CHOCOLATE, WHITE QUILLS [SWISS CHALET, 900 GR BOX] | 0,1
CHOCOLATE, WHITE/DARK QUILLS [MONA LISA, 4 #/CS] | 0,2
PASTRY INGR., CHOCOLATE QUILLS WHITE [SWISS CHALET FINE FO, 16 / 120 CT] | 0,4

like you can see it is not strong compare must be used I'm now use JaroWinkler and now result like this

CHOCOLATE, WHITE/DARK QUILLS [MONA LISA, 4 #/CS] | 0,3775
CHOCOLATE, WHITE QUILLS [SWISS CHALET, 900 GR BOX] | 0,3769
PASTRY INGR., CHOCOLATE QUILLS WHITE [SWISS CHALET FINE FO, 16 / 120 CT] | 0,3728
Katya
  • 13
  • 4

1 Answers1

0

With any ranking of text, you need to be explicit about what you're trying to measure. In your example

CHOCOLATE, WHITE QUILLS [SWISS CHALET, 900 GR BOX] | 0,1
CHOCOLATE, WHITE/DARK QUILLS [MONA LISA, 4 #/CS] | 0,2
PASTRY INGR., CHOCOLATE QUILLS WHITE [SWISS CHALET FINE FO, 16 / 120 CT] | 0,4

Why is the first item ranked lower than the second? I sort of understand why the bottom one has the highest rating, because it contains all the items in the string without intermediate strings. Provide some more details and we'll try to help.

dfb
  • 13,133
  • 2
  • 31
  • 52
  • I was looking for phrase "chocolate white quills" in first row its is founded "more left" in row in last string search string founded in middle of row. This is why i need this sorting. If I found my search string "more left" in row. I must show this row in “top” other must be lower – Katya May 19 '11 at 07:15