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
PositionBasedTermVectorMapper.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 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 {
16 public:
17 PositionBasedTermVectorMapper(bool ignoringOffsets = false);
18 virtual ~PositionBasedTermVectorMapper();
19
20 LUCENE_CLASS(PositionBasedTermVectorMapper);
21
22 protected:
23 MapStringMapIntTermVectorsPositionInfo fieldToTerms;
24
25 String currentField;
26
28 MapIntTermVectorsPositionInfo currentPositions;
29
30 bool storeOffsets;
31
32 public:
35 virtual bool isIgnoringPositions();
36
38 virtual void map(const String& term, int32_t frequency, Collection<TermVectorOffsetInfoPtr> offsets, Collection<int32_t> positions);
39
41 virtual void setExpectations(const String& field, int32_t numTerms, bool storeOffsets, bool storePositions);
42
46 MapStringMapIntTermVectorsPositionInfo getFieldToTerms();
47 };
48
50 class LPPAPI TermVectorsPositionInfo : public LuceneObject
51 {
52 public:
53 TermVectorsPositionInfo(int32_t position, bool storeOffsets);
54 virtual ~TermVectorsPositionInfo();
55
56 LUCENE_CLASS(TermVectorsPositionInfo);
57
58 protected:
59 int32_t position;
60 Collection<String> terms;
61 Collection<TermVectorOffsetInfoPtr> offsets;
62
63 public:
64 void addTerm(const String& term, TermVectorOffsetInfoPtr info);
65
67 int32_t getPosition();
68
71 Collection<String> getTerms();
72
76 Collection<TermVectorOffsetInfoPtr> getOffsets();
77 };
78 }
79
80 #endif

clucene.sourceforge.net