lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Tignor <ctig...@thinkmap.com>
Subject Re: NearSpansUnordered payloads
Date Tue, 24 Nov 2009 15:55:46 GMT
I am also having a hard time understanding the NewSpansUnordered
isPayloadAvilable() method.

For my test case where 2 tokens are at the same position, the code below
seems to be failing in traversing the 2 SpansCells.  The first SpansCell it
retrieves has its next field set to null so it cannot find the second one.
Is this normal behavior?

 // TODO: Remove warning after API has been finalized
  public boolean isPayloadAvailable() {
    SpansCell pointer = min();
    while (pointer != null) {
      if (pointer.isPayloadAvailable()) {
        return true;
      }
      pointer = pointer.next;
    }

    return false;
  }

When the linked list of SpanCells is first created they are linked together
normally but their order is reversed when adding them to the queue in list
toQueue() such that the last SpansCell with it's next field set o to null is
retrieved first.

C>T>

On Fri, Nov 20, 2009 at 6:49 PM, Jason Rutherglen <
jason.rutherglen@gmail.com> wrote:

> I'm interested in getting the payload information from the
> matching span, however it's unclear from the javadocs why
> NearSpansUnordered is different than NearSpansOrdered in this
> regard.
>
> NearSpansUnordered returns payloads in a hash set that's
> computed each method call by iterating over the SpanCell as a
> linked list, whereas NearSpansOrdered stores the payloads in a
> list (which is ordered) only when collectPayloads is true.
>
> At first glance I'm not sure how to correlate the payload with
> the span match using NSU, nor why they're different.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
TH!NKMAP

Christopher Tignor | Senior Software Architect
155 Spring Street NY, NY 10012
p.212-285-8600 x385 f.212-285-8999

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message