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

MappingCharFilter.h
Go to the documentation of this file.
1 // 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 MAPPINGCHARFILTER_H
8 #define MAPPINGCHARFILTER_H
9
10 #include "BaseCharFilter.h"
11
12 namespace Lucene {
13
16 class LPPAPI MappingCharFilter : public BaseCharFilter {
17 public:
19 MappingCharFilter(const NormalizeCharMapPtr& normMap, const CharStreamPtr& in);
20
22 MappingCharFilter(const NormalizeCharMapPtr& normMap, const ReaderPtr& in);
23
24 virtual ~MappingCharFilter();
25
26 LUCENE_CLASS(MappingCharFilter);
27
28 protected:
29 NormalizeCharMapPtr normMap;
30 Collection<wchar_t> buffer;
31 String replacement;
32 int32_t charPointer;
33 int32_t nextCharCounter;
34
35 public:
36 virtual int32_t read();
37 virtual int32_t read(wchar_t* buffer, int32_t offset, int32_t length);
38
39 protected:
40 int32_t nextChar();
41 void pushChar(int32_t c);
42 void pushLastChar(int32_t c);
43 NormalizeCharMapPtr match(const NormalizeCharMapPtr& map);
44 };
45
46 }
47
48 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::Collection< wchar_t >
Lucene::MappingCharFilter::buffer
Collection< wchar_t > buffer
Definition: MappingCharFilter.h:30
Lucene::MappingCharFilter::nextCharCounter
int32_t nextCharCounter
Definition: MappingCharFilter.h:33
Lucene::ReaderPtr
boost::shared_ptr< Reader > ReaderPtr
Definition: LuceneTypes.h:547
Lucene::CharStreamPtr
boost::shared_ptr< CharStream > CharStreamPtr
Definition: LuceneTypes.h:27
Lucene::MappingCharFilter
Simplistic CharFilter that applies the mappings contained in a NormalizeCharMap to the character stre...
Definition: MappingCharFilter.h:16
Lucene::BaseCharFilter
Base utility class for implementing a CharFilter. You subclass this, and then record mappings by call...
Definition: BaseCharFilter.h:16
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::MappingCharFilter::charPointer
int32_t charPointer
Definition: MappingCharFilter.h:32
Lucene::MappingCharFilter::replacement
String replacement
Definition: MappingCharFilter.h:31
BaseCharFilter.h
Lucene::NormalizeCharMapPtr
boost::shared_ptr< NormalizeCharMap > NormalizeCharMapPtr
Definition: LuceneTypes.h:38

clucene.sourceforge.net