> int gap = (pp[pp.length-1] - pp[0]) - (pp.length - 1);
>
> Don't want to cause an IndexOutOfBoundsException
Right... that's what I meant with "(boundary cases)"...
>Doron wrote:
> > int gap = (pp[pp.length] - pp[0]) - (pp.length - 1);
int gap = (pp[pp.length-1] - pp[0]) - (pp.length - 1);
Don't want to cause an IndexOutOfBoundsException
-Paul
-
To unsubscribe, e-mail: java-user-unsub
Thanks for the discussion, I really appreciate you pointing out that the
> Code here ignores PhraseQuery (PQ) 's positions:
And by "here" you mean my original code not your suggestion.
> To accommodate for this, the overall extra gap can be added to the slope:
> int gap = (pp[pp.length] -
Hi,
Code here ignores PhraseQuery (PQ) 's positions:
int[] pp = PQ.getPositions();
These positions have extra gaps when stop words are removed.
To accommodate for this, the overall extra gap can be added to the slope:
int gap = (pp[pp.length] - pp[0]) - (pp.length - 1); // (+/- bounda
In Lucene, 3.4 I recently implemented "Translating PhraseQuery to
SpanNearQuery" (see Lucene in Action, page 220) because I wanted _order_ to
matter.
Here is my exact code called from getFieldsQuery once I know I'm looking at a
PhraseQuery, but I think it is exactly from the book.
static Q