Lucene++ - a full-featured, c++ search engine
API Documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
include
PositionBasedTermVectorMapper.h
Go to the documentation of this file.
1
2
// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3
// Distributable under the terms of either the Apache License (Version 2.0)
4
// or the GNU Lesser General Public License.
6
7
#ifndef POSITIONBASEDTERMVECTORMAPPER_H
8
#define POSITIONBASEDTERMVECTORMAPPER_H
9
10
#include "
TermVectorMapper.h
"
11
12
namespace
Lucene {
13
14
class
LPPAPI
PositionBasedTermVectorMapper
:
public
TermVectorMapper
{
15
public
:
16
PositionBasedTermVectorMapper
(
bool
ignoringOffsets =
false
);
17
virtual
~
PositionBasedTermVectorMapper
();
18
19
LUCENE_CLASS
(
PositionBasedTermVectorMapper
);
20
21
protected
:
22
MapStringMapIntTermVectorsPositionInfo fieldToTerms;
23
24
String
currentField
;
25
27
MapIntTermVectorsPositionInfo
currentPositions
;
28
29
bool
storeOffsets
;
30
31
public
:
34
virtual
bool
isIgnoringPositions();
35
37
virtual
void
map(
const
String& term, int32_t frequency,
Collection<TermVectorOffsetInfoPtr>
offsets,
Collection<int32_t>
positions);
38
40
virtual
void
setExpectations(
const
String& field, int32_t numTerms,
bool
storeOffsets,
bool
storePositions);
41
45
MapStringMapIntTermVectorsPositionInfo getFieldToTerms();
46
};
47
49
class
LPPAPI
TermVectorsPositionInfo
:
public
LuceneObject
{
50
public
:
51
TermVectorsPositionInfo
(int32_t position,
bool
storeOffsets);
52
virtual
~
TermVectorsPositionInfo
();
53
54
LUCENE_CLASS
(
TermVectorsPositionInfo
);
55
56
protected
:
57
int32_t position;
58
Collection<String>
terms
;
59
Collection<TermVectorOffsetInfoPtr>
offsets
;
60
61
public
:
62
void
addTerm(
const
String& term,
const
TermVectorOffsetInfoPtr
& info);
63
65
int32_t getPosition();
66
69
Collection<String>
getTerms();
70
74
Collection<TermVectorOffsetInfoPtr>
getOffsets();
75
};
76
77
}
78
79
#endif
clucene.sourceforge.net