CLucene - a full-featured, c++ search engine
API Documentation


lucene::index::SegmentTermPositionVector Class Reference

#include <TermVector.h>

Inheritance diagram for lucene::index::SegmentTermPositionVector:
lucene::index::SegmentTermVector lucene::index::TermPositionVector lucene::index::TermFreqVector lucene::index::TermFreqVector lucene::debug::LuceneBase lucene::debug::LuceneBase

List of all members.

Public Member Functions

 SegmentTermPositionVector (const TCHAR *field, TCHAR **terms, Array< int32_t > *termFreqs, Array< Array< int32_t > > *positions, Array< Array< TermVectorOffsetInfo > > *offsets)
 ~SegmentTermPositionVector ()
Array< TermVectorOffsetInfo > * getOffsets (int32_t index)
 Returns an array of TermVectorOffsetInfo in which the term is found.
Array< int32_t > * getTermPositions (int32_t index)
 Returns an array of positions in which the term is found.
const TCHAR * getField ()
TCHAR * toString () const
int32_t size ()
const TCHAR ** getTerms ()
const Array< int32_t > * getTermFrequencies ()
 Array of term frequencies.
int32_t indexOf (const TCHAR *termText)
 Return an index in the term numbers array returned from getTerms at which the term with the specified term appears.
void indexesOf (const TCHAR **termNumbers, const int32_t start, const int32_t len, Array< int32_t > &ret)
 Just like indexOf(int32_t) but searches for a number of terms at the same time.
virtual TermPositionVector__asTermPositionVector ()
 Solve the diamond inheritence problem by providing a reinterpret function.

Protected Attributes

Array< Array< int32_t > > * positions
Array< Array
< TermVectorOffsetInfo > > * 
offsets

Static Protected Attributes

static Array< int32_t > EMPTY_TERM_POS

Constructor & Destructor Documentation

lucene::index::SegmentTermPositionVector::SegmentTermPositionVector ( const TCHAR *  field,
TCHAR **  terms,
Array< int32_t > *  termFreqs,
Array< Array< int32_t > > *  positions,
Array< Array< TermVectorOffsetInfo > > *  offsets 
)
lucene::index::SegmentTermPositionVector::~SegmentTermPositionVector (  ) 

Member Function Documentation

virtual TermPositionVector* lucene::index::SegmentTermPositionVector::__asTermPositionVector (  )  [virtual]

Solve the diamond inheritence problem by providing a reinterpret function.

No dynamic casting is required and no RTTI data is needed to do this

Reimplemented from lucene::index::SegmentTermVector.

const TCHAR* lucene::index::SegmentTermPositionVector::getField (  )  [inline, virtual]
Returns:
The number of the field this vector is associated with

Reimplemented from lucene::index::SegmentTermVector.

Array<TermVectorOffsetInfo>* lucene::index::SegmentTermPositionVector::getOffsets ( int32_t  index  )  [virtual]

Returns an array of TermVectorOffsetInfo in which the term is found.

Parameters:
index The position in the array to get the offsets from
Returns:
An array of TermVectorOffsetInfo objects or the empty list
See also:
org.apache.lucene.analysis.Token

Implements lucene::index::TermPositionVector.

const Array<int32_t>* lucene::index::SegmentTermPositionVector::getTermFrequencies (  )  [inline, virtual]

Array of term frequencies.

Locations of the array correspond one to one to the terms in the array obtained from getTerms method. Each location in the array contains the number of times this term occurs in the document or the document field.

The size of the returned array is size()

Memory management:
Returning a pointer to internal data. Do not delete.

Reimplemented from lucene::index::SegmentTermVector.

Array<int32_t>* lucene::index::SegmentTermPositionVector::getTermPositions ( int32_t  index  )  [virtual]

Returns an array of positions in which the term is found.

Terms are identified by the index at which its number appears in the term String array obtained from the indexOf method.

Implements lucene::index::TermPositionVector.

const TCHAR** lucene::index::SegmentTermPositionVector::getTerms (  )  [inline, virtual]
Returns:
An Array of term texts in ascending order.

Reimplemented from lucene::index::SegmentTermVector.

void lucene::index::SegmentTermPositionVector::indexesOf ( const TCHAR **  terms,
const int32_t  start,
const int32_t  len,
Array< int32_t > &  ret 
) [inline, virtual]

Just like indexOf(int32_t) but searches for a number of terms at the same time.

Returns an array that has the same size as the number of terms searched for, each slot containing the result of searching for that term number.

Parameters:
terms array containing terms to look for
start index in the array where the list of terms starts
len the number of terms in the list

Reimplemented from lucene::index::SegmentTermVector.

int32_t lucene::index::SegmentTermPositionVector::indexOf ( const TCHAR *  term  )  [inline, virtual]

Return an index in the term numbers array returned from getTerms at which the term with the specified term appears.

If this term does not appear in the array, return -1.

Reimplemented from lucene::index::SegmentTermVector.

int32_t lucene::index::SegmentTermPositionVector::size (  )  [inline, virtual]
Returns:
The number of terms in the term vector.

Reimplemented from lucene::index::SegmentTermVector.

TCHAR* lucene::index::SegmentTermPositionVector::toString (  )  const [inline]

Reimplemented from lucene::index::SegmentTermVector.


Member Data Documentation


The documentation for this class was generated from the following file:

clucene.sourceforge.net