This project has retired. For details please refer to its Attic page.
Lucy::Search::Span – C API Documentation
Apache Lucy™

Lucy::Search::Span

parcel Lucy
class variable LUCY_SPAN
struct symbol lucy_Span
class nickname lucy_Span
header file Lucy/Search/Span.h

Name

Lucy::Search::Span – An offset, a length, and a weight.

Description

Span objects store information about a span across an array of… something. The unit is context-dependent.

Text is one possibility, in which case offset and length might be measured in Unicode code points. However, the Span could also refer to a span within an array of tokens, for example – in which case the start and offset might be measured in token positions.

Functions

new
lucy_Span* // incremented
lucy_Span_new(
    int32_t offset,
    int32_t length,
    float weight
);

Create a new Span.

offset

Integer offset, unit is context-dependent.

length

Integer length, unit is context-dependent.

weight

A floating point weight.

init
lucy_Span*
lucy_Span_init(
    lucy_Span *self,
    int32_t offset,
    int32_t length,
    float weight
);

Initialize a Span. See new() for a description of the parameters.

Methods

Get_Offset
int32_t
lucy_Span_Get_Offset(
    lucy_Span *self
);

Accessor for offset attribute.

Set_Offset
void
lucy_Span_Set_Offset(
    lucy_Span *self,
    int32_t offset
);

Setter for offset attribute.

Get_Length
int32_t
lucy_Span_Get_Length(
    lucy_Span *self
);

Accessor for length attribute.

Set_Length
void
lucy_Span_Set_Length(
    lucy_Span *self,
    int32_t length
);

Setter for length attribute.

Get_Weight
float
lucy_Span_Get_Weight(
    lucy_Span *self
);

Accessor for weight attribute.

Set_Weight
void
lucy_Span_Set_Weight(
    lucy_Span *self,
    float weight
);

Setter for weight attribute.

Equals
bool
lucy_Span_Equals(
    lucy_Span *self,
    cfish_Obj *other
);

Indicate whether two objects are the same. By default, compares the memory address.

other

Another Obj.

Compare_To
int32_t
lucy_Span_Compare_To(
    lucy_Span *self,
    cfish_Obj *other
);

Indicate whether one object is less than, equal to, or greater than another.

other

Another Obj.

Returns: 0 if the objects are equal, a negative number if self is less than other, and a positive number if self is greater than other.

Inheritance

Lucy::Search::Span is a Clownfish::Obj.