summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts/tokenizer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/fts/tokenizer.h')
-rw-r--r--src/mongo/db/fts/tokenizer.h54
1 files changed, 25 insertions, 29 deletions
diff --git a/src/mongo/db/fts/tokenizer.h b/src/mongo/db/fts/tokenizer.h
index 503816cc434..f1184a455f2 100644
--- a/src/mongo/db/fts/tokenizer.h
+++ b/src/mongo/db/fts/tokenizer.h
@@ -38,41 +38,37 @@
namespace mongo {
- namespace fts {
+namespace fts {
- struct Token {
- enum Type { WHITESPACE, DELIMITER, TEXT, INVALID };
- Token( Type type, StringData data, unsigned offset)
- : type( type ),
- data( data ),
- offset( offset )
- {}
+struct Token {
+ enum Type { WHITESPACE, DELIMITER, TEXT, INVALID };
+ Token(Type type, StringData data, unsigned offset) : type(type), data(data), offset(offset) {}
- bool ok() const { return type != INVALID; }
-
- Type type;
- StringData data;
- unsigned offset;
- };
+ bool ok() const {
+ return type != INVALID;
+ }
- class Tokenizer {
- MONGO_DISALLOW_COPYING( Tokenizer );
- public:
+ Type type;
+ StringData data;
+ unsigned offset;
+};
- Tokenizer( const FTSLanguage* language, StringData str);
+class Tokenizer {
+ MONGO_DISALLOW_COPYING(Tokenizer);
- bool more() const;
- Token next();
+public:
+ Tokenizer(const FTSLanguage* language, StringData str);
- private:
- Token::Type _type( char c ) const;
- bool _skipWhitespace();
+ bool more() const;
+ Token next();
- unsigned _pos;
- const StringData _raw;
- bool _english;
- };
+private:
+ Token::Type _type(char c) const;
+ bool _skipWhitespace();
- }
+ unsigned _pos;
+ const StringData _raw;
+ bool _english;
+};
+}
}
-