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
00043 class XAPIAN_VISIBILITY_DEFAULT TermGenerator {
00044 public:
00046 class Internal;
00048 Xapian::Internal::RefCntPtr<Internal> internal;
00049
00051 TermGenerator(const TermGenerator & o);
00052
00054 TermGenerator & operator=(const TermGenerator & o);
00055
00057 TermGenerator();
00058
00060 ~TermGenerator();
00061
00063 void set_stemmer(const Xapian::Stem & stemmer);
00064
00066 void set_stopper(const Xapian::Stopper *stop = NULL);
00067
00069 void set_document(const Xapian::Document & doc);
00070
00072 const Xapian::Document & get_document() const;
00073
00079 void index_text(const Xapian::Utf8Iterator & itor,
00080 Xapian::termcount weight = 1,
00081 const std::string & prefix = "");
00082
00088 void index_text(const std::string & text,
00089 Xapian::termcount weight = 1,
00090 const std::string & prefix = "") {
00091 return index_text(Utf8Iterator(text), weight, prefix);
00092 }
00093
00100 void index_text_without_positions(const Xapian::Utf8Iterator & itor,
00101 Xapian::termcount weight = 1,
00102 const std::string & prefix = "");
00103
00110 void index_text_without_positions(const std::string & text,
00111 Xapian::termcount weight = 1,
00112 const std::string & prefix = "") {
00113 return index_text_without_positions(Utf8Iterator(text), weight, prefix);
00114 }
00115
00121 void increase_termpos(Xapian::termcount delta = 100);
00122
00124 Xapian::termcount get_termpos() const;
00125
00127 void set_termpos(Xapian::termcount termpos);
00128
00130 std::string get_description() const;
00131 };
00132
00133 }
00134
00135 #endif // XAPIAN_INCLUDED_TERMGENERATOR_H