00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef XAPIAN_INCLUDED_TERMGENERATOR_H
00022 #define XAPIAN_INCLUDED_TERMGENERATOR_H
00023
00024 #include <xapian/base.h>
00025 #include <xapian/types.h>
00026 #include <xapian/unicode.h>
00027 #include <xapian/visibility.h>
00028
00029 #include <string>
00030
00031 namespace Xapian {
00032
00033 class Document;
00034 class Stem;
00035 class Stopper;
00036
00038 class XAPIAN_VISIBILITY_DEFAULT TermGenerator {
00039 public:
00041 class Internal;
00043 Xapian::Internal::RefCntPtr<Internal> internal;
00044
00046 TermGenerator(const TermGenerator & o);
00047
00049 TermGenerator & operator=(const TermGenerator & o);
00050
00052 TermGenerator();
00053
00055 ~TermGenerator();
00056
00058 void set_stemmer(const Xapian::Stem & stemmer);
00059
00061 void set_stopper(const Xapian::Stopper *stop = NULL);
00062
00064 void set_document(const Xapian::Document & doc);
00065
00067 const Xapian::Document & get_document() const;
00068
00070 void index_text(const Xapian::Utf8Iterator & itor,
00071 Xapian::termcount weight = 1,
00072 const std::string & prefix = "");
00073
00075 void index_text(const std::string & text,
00076 Xapian::termcount weight = 1,
00077 const std::string & prefix = "") {
00078 return index_text(Utf8Iterator(text), weight, prefix);
00079 }
00080
00082 void index_text_without_positions(const Xapian::Utf8Iterator & itor,
00083 Xapian::termcount weight = 1,
00084 const std::string & prefix = "");
00085
00087 void index_text_without_positions(const std::string & text,
00088 Xapian::termcount weight = 1,
00089 const std::string & prefix = "") {
00090 return index_text_without_positions(Utf8Iterator(text), weight, prefix);
00091 }
00092
00098 void increase_termpos(Xapian::termcount delta = 100);
00099
00101 Xapian::termcount get_termpos() const;
00102
00104 void set_termpos(Xapian::termcount termpos);
00105
00107 std::string get_description() const;
00108 };
00109
00110 }
00111
00112 #endif // XAPIAN_INCLUDED_TERMGENERATOR_H