| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team.
|
|---|
| 4 | ** All rights reserved.
|
|---|
| 5 | **
|
|---|
| 6 | ** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 7 | ** All rights reserved.
|
|---|
| 8 | **
|
|---|
| 9 | ** This file may be used under the terms of the GNU Lesser General Public
|
|---|
| 10 | ** License version 2.1 as published by the Free Software Foundation and
|
|---|
| 11 | ** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|---|
| 12 | ** Please review the following information to ensure the GNU Lesser General
|
|---|
| 13 | ** Public License version 2.1 requirements will be met:
|
|---|
| 14 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 15 | **
|
|---|
| 16 | ****************************************************************************/
|
|---|
| 17 |
|
|---|
| 18 | #ifndef QTOKENIZER_P_H
|
|---|
| 19 | #define QTOKENIZER_P_H
|
|---|
| 20 |
|
|---|
| 21 | //
|
|---|
| 22 | // W A R N I N G
|
|---|
| 23 | // -------------
|
|---|
| 24 | //
|
|---|
| 25 | // This file is not part of the Qt API. It exists for the convenience
|
|---|
| 26 | // of the help generator tools. This header file may change from version
|
|---|
| 27 | // to version without notice, or even be removed.
|
|---|
| 28 | //
|
|---|
| 29 | // We mean it.
|
|---|
| 30 | //
|
|---|
| 31 |
|
|---|
| 32 | #include "qtoken_p.h"
|
|---|
| 33 | #include "qreader_p.h"
|
|---|
| 34 | #include "qtokenstream_p.h"
|
|---|
| 35 | #include "qclucene_global_p.h"
|
|---|
| 36 |
|
|---|
| 37 | #include <QtCore/QChar>
|
|---|
| 38 | #include <QtCore/QString>
|
|---|
| 39 |
|
|---|
| 40 | QT_BEGIN_NAMESPACE
|
|---|
| 41 |
|
|---|
| 42 | class QHELP_EXPORT QCLuceneTokenizer : public QCLuceneTokenStream
|
|---|
| 43 | {
|
|---|
| 44 | public:
|
|---|
| 45 | QCLuceneTokenizer(const QCLuceneReader &reader);
|
|---|
| 46 | virtual ~QCLuceneTokenizer();
|
|---|
| 47 |
|
|---|
| 48 | void close();
|
|---|
| 49 | bool next(QCLuceneToken &token);
|
|---|
| 50 |
|
|---|
| 51 | protected:
|
|---|
| 52 | friend class QCLuceneStandardTokenizer;
|
|---|
| 53 |
|
|---|
| 54 | private:
|
|---|
| 55 | QCLuceneTokenizer();
|
|---|
| 56 | QCLuceneReader reader;
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 | class QHELP_EXPORT QCLuceneStandardTokenizer : public QCLuceneTokenizer
|
|---|
| 60 | {
|
|---|
| 61 | public:
|
|---|
| 62 | QCLuceneStandardTokenizer(const QCLuceneReader &reader);
|
|---|
| 63 | ~QCLuceneStandardTokenizer();
|
|---|
| 64 |
|
|---|
| 65 | bool readApostrophe(const QString &string, QCLuceneToken &token);
|
|---|
| 66 | bool readAt(const QString &string, QCLuceneToken &token);
|
|---|
| 67 | bool readCompany(const QString &string, QCLuceneToken &token);
|
|---|
| 68 | };
|
|---|
| 69 |
|
|---|
| 70 | class QCLuceneCharTokenizer : public QCLuceneTokenizer
|
|---|
| 71 | {
|
|---|
| 72 |
|
|---|
| 73 | };
|
|---|
| 74 |
|
|---|
| 75 | class QCLuceneLetterTokenizer : public QCLuceneCharTokenizer
|
|---|
| 76 | {
|
|---|
| 77 |
|
|---|
| 78 | };
|
|---|
| 79 |
|
|---|
| 80 | class QCLuceneLowerCaseTokenizer : public QCLuceneLetterTokenizer
|
|---|
| 81 | {
|
|---|
| 82 |
|
|---|
| 83 | };
|
|---|
| 84 |
|
|---|
| 85 | class QCLuceneWhitespaceTokenizer : public QCLuceneCharTokenizer
|
|---|
| 86 | {
|
|---|
| 87 |
|
|---|
| 88 | };
|
|---|
| 89 |
|
|---|
| 90 | class QCLuceneKeywordTokenizer : public QCLuceneTokenizer
|
|---|
| 91 | {
|
|---|
| 92 |
|
|---|
| 93 | };
|
|---|
| 94 |
|
|---|
| 95 | QT_END_NAMESPACE
|
|---|
| 96 |
|
|---|
| 97 | #endif // QTOKENIZER_P_H
|
|---|