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 
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

Documentation for Xapian (version 1.0.0).
Generated on 18 May 2007 by Doxygen 1.4.6.