The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 QueryParser Rules
Subject:  Just one confusing bit
Date:  2005-03-02 16:27:09
From:  trejkaz


Quoting the article:

"Note that "world * hello" does not match with a slop factor of 2. Why? Because the number of moves to get that back to "hello world" is 3. Hopping the word "world" to the asterisk position is one, to the "hello" position is two, and the third hop makes the exact match."

I don't follow. In the case of "World * Hello":

1. Swap "World" with "*".
2. Swap "World" with "Hello". Complete!

And in the case of "Hello * * World":

1. Swap "World" with "*".
2. Swap "World" with "*". Complete!

They both take two steps, so why is one slop 2 and the other slop 3?

 Feed java.net RSS Feeds