include/xapian/termgenerator.h

Go to the documentation of this file.
00001 
00004 /* Copyright (C) 2007 Olly Betts
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
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

Documentation for Xapian (version 1.0.1).
Generated on 11 Jun 2007 by Doxygen 1.4.6.