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

Loading...
Searching...
No Matches
MappingCharFilter.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 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
BaseCharFilter.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::BaseCharFilter
Base utility class for implementing a CharFilter. You subclass this, and then record mappings by call...
Definition BaseCharFilter.h:16
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::MappingCharFilter
Simplistic CharFilter that applies the mappings contained in a NormalizeCharMap to the character stre...
Definition MappingCharFilter.h:16
Lucene::MappingCharFilter::charPointer
int32_t charPointer
Definition MappingCharFilter.h:32
Lucene::MappingCharFilter::pushChar
void pushChar(int32_t c)
Lucene::MappingCharFilter::normMap
NormalizeCharMapPtr normMap
Definition MappingCharFilter.h:29
Lucene::MappingCharFilter::replacement
String replacement
Definition MappingCharFilter.h:31
Lucene::MappingCharFilter::~MappingCharFilter
virtual ~MappingCharFilter()
Lucene::MappingCharFilter::MappingCharFilter
MappingCharFilter(const NormalizeCharMapPtr &normMap, const CharStreamPtr &in)
Default constructor that takes a CharStream.
Lucene::MappingCharFilter::MappingCharFilter
MappingCharFilter(const NormalizeCharMapPtr &normMap, const ReaderPtr &in)
Easy-use constructor that takes a Reader.
Lucene::MappingCharFilter::pushLastChar
void pushLastChar(int32_t c)
Lucene::MappingCharFilter::nextCharCounter
int32_t nextCharCounter
Definition MappingCharFilter.h:33
Lucene::MappingCharFilter::nextChar
int32_t nextChar()
Lucene::MappingCharFilter::match
NormalizeCharMapPtr match(const NormalizeCharMapPtr &map)
Lucene::MappingCharFilter::read
virtual int32_t read(wchar_t *buffer, int32_t offset, int32_t length)
Read characters into a portion of an array.
Lucene::MappingCharFilter::read
virtual int32_t read()
Read a single character.
Lucene::MappingCharFilter::buffer
Collection< wchar_t > buffer
Definition MappingCharFilter.h:30
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::NormalizeCharMapPtr
boost::shared_ptr< NormalizeCharMap > NormalizeCharMapPtr
Definition LuceneTypes.h:38
Lucene::ReaderPtr
boost::shared_ptr< Reader > ReaderPtr
Definition LuceneTypes.h:547
Lucene::CharStreamPtr
boost::shared_ptr< CharStream > CharStreamPtr
Definition LuceneTypes.h:27

clucene.sourceforge.net