Exemplo n.º 1
0
		protected internal SpanScorer(Spans spans, Weight weight, Similarity similarity, byte[] norms):base(similarity)
		{
			this.spans = spans;
			this.norms = norms;
			this.weight = weight;
			this.value_Renamed = weight.GetValue();
			if (this.spans.Next())
			{
				doc = - 1;
			}
			else
			{
				doc = NO_MORE_DOCS;
				more = false;
			}
		}
Exemplo n.º 2
0
		/// <summary>Check whether two Spans in the same document are ordered.</summary>
		/// <param name="spans1">
		/// </param>
		/// <param name="spans2">
		/// </param>
		/// <returns> true iff spans1 starts before spans2
		/// or the spans start at the same position,
		/// and spans1 ends before spans2.
		/// </returns>
		internal static bool DocSpansOrdered(Spans spans1, Spans spans2)
		{
			System.Diagnostics.Debug.Assert(spans1.Doc() == spans2.Doc(), "doc1 " + spans1.Doc() + " != doc2 " + spans2.Doc());
			int start1 = spans1.Start();
			int start2 = spans2.Start();
			/* Do not call docSpansOrdered(int,int,int,int) to avoid invoking .end() : */
			return (start1 == start2)?(spans1.End() < spans2.End()):(start1 < start2);
		}
Exemplo n.º 3
0
            // TODO: Remove warning after API has been finalized
            public override bool IsPayloadAvailable()
            {
                Spans top = Top();

                return(top != null && top.IsPayloadAvailable());
            }
Exemplo n.º 4
0
			public SpansCell(NearSpansUnordered enclosingInstance, Spans spans, int index)
			{
				InitBlock(enclosingInstance);
				this.spans = spans;
				this.index = index;
			}
Exemplo n.º 5
0
 public SpansCell(NearSpansUnordered enclosingInstance, Spans spans, int index)
 {
     InitBlock(enclosingInstance);
     this.spans = spans;
     this.index = index;
 }