error.h | error.h | |||
---|---|---|---|---|
/** @file error.h | /** @file error.h | |||
* @brief Hierarchy of classes which Xapian can throw as exceptions. | * @brief Hierarchy of classes which Xapian can throw as exceptions. | |||
*/ | */ | |||
/* Warning: This file is generated by /data/home/olly/tmp/xapian-svn-snapsh ot/tags/1.2.10/xapian/xapian-core/generate-exceptions - do not modify direc tly! */ | /* Warning: This file is generated by /data/home/olly/tmp/xapian-svn-snapsh ot/tags/1.2.11/xapian/xapian-core/generate-exceptions - do not modify direc tly! */ | |||
/* Copyright (C) 2003,2004,2006,2007,2009 Olly Betts | /* Copyright (C) 2003,2004,2006,2007,2009 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
positioniterator.h | positioniterator.h | |||
---|---|---|---|---|
/** \file positioniterator.h | /** \file positioniterator.h | |||
* \brief Classes for iterating through position lists | * \brief Classes for iterating through position lists | |||
*/ | */ | |||
/* Copyright 1999,2000,2001 BrightStation PLC | /* Copyright 1999,2000,2001 BrightStation PLC | |||
* Copyright 2002 Ananova Ltd | * Copyright 2002 Ananova Ltd | |||
* Copyright 2003,2004,2007,2009 Olly Betts | * Copyright 2003,2004,2007,2009,2012 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 76 | skipping to change at line 76 | |||
/** Copying is allowed. The internals are reference counted, so | /** Copying is allowed. The internals are reference counted, so | |||
* copying is also cheap. | * copying is also cheap. | |||
*/ | */ | |||
PositionIterator(const PositionIterator &o); | PositionIterator(const PositionIterator &o); | |||
/** Assignment is allowed. The internals are reference counted, | /** Assignment is allowed. The internals are reference counted, | |||
* so assignment is also cheap. | * so assignment is also cheap. | |||
*/ | */ | |||
void operator=(const PositionIterator &o); | void operator=(const PositionIterator &o); | |||
/// Return the term position at the current iterator position. | ||||
Xapian::termpos operator *() const; | Xapian::termpos operator *() const; | |||
/// Advance the iterator to the next position. | ||||
PositionIterator & operator++(); | PositionIterator & operator++(); | |||
/// Advance the iterator to the next position (postfix version). | ||||
DerefWrapper_<termpos> operator++(int) { | DerefWrapper_<termpos> operator++(int) { | |||
Xapian::termpos tmp = **this; | Xapian::termpos tmp = **this; | |||
operator++(); | operator++(); | |||
return DerefWrapper_<termpos>(tmp); | return DerefWrapper_<termpos>(tmp); | |||
} | } | |||
/** Advance the iterator to the specified termpos. | /** Advance the iterator to the specified termpos. | |||
* | * | |||
* If the specified termpos isn't in the list, position ourselves o n the | * If the specified termpos isn't in the list, position ourselves o n the | |||
* first termpos after it (or at_end() if no greater term positions are | * first termpos after it (or at_end() if no greater term positions are | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added | |||
postingiterator.h | postingiterator.h | |||
---|---|---|---|---|
/** \file postingiterator.h | /** \file postingiterator.h | |||
* \brief Classes for iterating through posting lists | * \brief Classes for iterating through posting lists | |||
*/ | */ | |||
/* Copyright 1999,2000,2001 BrightStation PLC | /* Copyright 1999,2000,2001 BrightStation PLC | |||
* Copyright 2002 Ananova Ltd | * Copyright 2002 Ananova Ltd | |||
* Copyright 2003,2004,2005,2007,2008,2009 Olly Betts | * Copyright 2003,2004,2005,2007,2008,2009,2012 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 73 | skipping to change at line 73 | |||
/** Copying is allowed. The internals are reference counted, so | /** Copying is allowed. The internals are reference counted, so | |||
* copying is also cheap. | * copying is also cheap. | |||
*/ | */ | |||
PostingIterator(const PostingIterator &other); | PostingIterator(const PostingIterator &other); | |||
/** Assignment is allowed. The internals are reference counted, | /** Assignment is allowed. The internals are reference counted, | |||
* so assignment is also cheap. | * so assignment is also cheap. | |||
*/ | */ | |||
void operator=(const PostingIterator &other); | void operator=(const PostingIterator &other); | |||
/// Advance the iterator to the next position. | ||||
PostingIterator & operator++(); | PostingIterator & operator++(); | |||
/// Advance the iterator to the next position (postfix version). | ||||
DerefWrapper_<docid> operator++(int) { | DerefWrapper_<docid> operator++(int) { | |||
Xapian::docid tmp = **this; | Xapian::docid tmp = **this; | |||
operator++(); | operator++(); | |||
return DerefWrapper_<docid>(tmp); | return DerefWrapper_<docid>(tmp); | |||
} | } | |||
/** Advance the iterator to the specified docid. | /** Advance the iterator to the specified docid. | |||
* | * | |||
* If the specified docid isn't in the list, position ourselves on the | * If the specified docid isn't in the list, position ourselves on the | |||
* first document after it (or at_end() if no greater docids are | * first document after it (or at_end() if no greater docids are | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||
query.h | query.h | |||
---|---|---|---|---|
/** \file query.h | /** \file query.h | |||
* \brief Classes for representing a query | * \brief Classes for representing a query | |||
*/ | */ | |||
/* Copyright 1999,2000,2001 BrightStation PLC | /* Copyright 1999,2000,2001 BrightStation PLC | |||
* Copyright 2002 Ananova Ltd | * Copyright 2002 Ananova Ltd | |||
* Copyright 2003,2004,2005,2006,2007,2008,2009 Olly Betts | * Copyright 2003,2004,2005,2006,2007,2008,2009,2012 Olly Betts | |||
* Copyright 2006,2007,2008,2009 Lemur Consulting Ltd | * Copyright 2006,2007,2008,2009 Lemur Consulting Ltd | |||
* Copyright 2008 Richard Boulton | * Copyright 2008 Richard Boulton | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
skipping to change at line 218 | skipping to change at line 218 | |||
/** A query consisting of two termnames opp-ed together. */ | /** A query consisting of two termnames opp-ed together. */ | |||
Query(Query::op op_, | Query(Query::op op_, | |||
const std::string & left, const std::string & right); | const std::string & left, const std::string & right); | |||
/** Combine a number of Xapian::Query-s with the specified operator. | /** Combine a number of Xapian::Query-s with the specified operator. | |||
* | * | |||
* The Xapian::Query objects are specified with begin and end | * The Xapian::Query objects are specified with begin and end | |||
* iterators. | * iterators. | |||
* | * | |||
* AND, OR, SYNONYM, NEAR and PHRASE can take any number of subquer | * AND, OR, XOR, ELITE_SET, SYNONYM, NEAR and PHRASE can take any | |||
ies. | * number of subqueries. Other operators take exactly two subqueri | |||
* Other operators take exactly two subqueries. | es. | |||
* | * | |||
* The iterators may be to Xapian::Query objects, pointers to | * The iterators may be to Xapian::Query objects, pointers to | |||
* Xapian::Query objects, or termnames (std::string-s). | * Xapian::Query objects, or termnames (std::string-s). | |||
* | * | |||
* For NEAR and PHRASE, a window size can be specified in parameter . | * For NEAR and PHRASE, a window size can be specified in parameter . | |||
* | * | |||
* For ELITE_SET, the elite set size can be specified in parameter. | * For ELITE_SET, the elite set size can be specified in parameter. | |||
*/ | */ | |||
template <class Iterator> | template <class Iterator> | |||
Query(Query::op op_, Iterator qbegin, Iterator qend, | Query(Query::op op_, Iterator qbegin, Iterator qend, | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
queryparser.h | queryparser.h | |||
---|---|---|---|---|
skipping to change at line 412 | skipping to change at line 412 | |||
/** The default flags. | /** The default flags. | |||
* | * | |||
* Used if you don't explicitly pass any to @a parse_query(). | * Used if you don't explicitly pass any to @a parse_query(). | |||
* The default flags are FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE. | * The default flags are FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE. | |||
* | * | |||
* Added in Xapian 1.0.11. | * Added in Xapian 1.0.11. | |||
*/ | */ | |||
FLAG_DEFAULT = FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE | FLAG_DEFAULT = FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE | |||
} feature_flag; | } feature_flag; | |||
typedef enum { STEM_NONE, STEM_SOME, STEM_ALL } stem_strategy; | /// Stemming strategies, for use with set_stemming_strategy(). | |||
typedef enum { STEM_NONE, STEM_SOME, STEM_ALL, STEM_ALL_Z } stem_strate | ||||
gy; | ||||
/// Copy constructor. | /// Copy constructor. | |||
QueryParser(const QueryParser & o); | QueryParser(const QueryParser & o); | |||
/// Assignment. | /// Assignment. | |||
QueryParser & operator=(const QueryParser & o); | QueryParser & operator=(const QueryParser & o); | |||
/// Default constructor. | /// Default constructor. | |||
QueryParser(); | QueryParser(); | |||
skipping to change at line 445 | skipping to change at line 446 | |||
*/ | */ | |||
void set_stemmer(const Xapian::Stem & stemmer); | void set_stemmer(const Xapian::Stem & stemmer); | |||
/** Set the stemming strategy. | /** Set the stemming strategy. | |||
* | * | |||
* This controls how the query parser will apply the stemming algorith m. | * This controls how the query parser will apply the stemming algorith m. | |||
* Note that the stemming algorithm is only applied to words in | * Note that the stemming algorithm is only applied to words in | |||
* probabilistic fields - boolean filter terms are never stemmed. | * probabilistic fields - boolean filter terms are never stemmed. | |||
* | * | |||
* @param strategy The strategy to use - possible values are: | * @param strategy The strategy to use - possible values are: | |||
* - STEM_NONE: Don't perform any stemming (the default). | * - STEM_NONE: Don't perform any stemming. (default in Xapian <= | |||
* - STEM_SOME: Search for stemmed forms of terms except for those wh | * 1.3.0) | |||
ich | * - STEM_SOME: Search for stemmed forms of terms except for those | |||
* start with a capital letter, or are followed by certai | * which start with a capital letter, or are followed b | |||
n | y | |||
* characters (currently: (/\@<>=*[{" ), or are used with | * certain characters (currently: (/\@<>=*[{" ), or are | |||
* operators which need positional information. Stemmed | * used with operators which need positional informatio | |||
* terms are prefixed with 'Z'. | n. | |||
* - STEM_ALL: Search for stemmed forms of all words (note: no 'Z' | * Stemmed terms are prefixed with 'Z'. (default in | |||
* prefix is added). | * Xapian >= 1.3.1) | |||
* - STEM_ALL: Search for stemmed forms of all words (note: no 'Z' | ||||
* prefix is added). | ||||
* - STEM_ALL_Z: Search for stemmed forms of all words (note: 'Z' | ||||
* prefix is added). (new in Xapian 1.2.11 and 1.3.1) | ||||
*/ | */ | |||
void set_stemming_strategy(stem_strategy strategy); | void set_stemming_strategy(stem_strategy strategy); | |||
/** Set the stopper. | /** Set the stopper. | |||
* | * | |||
* @param stop The Stopper object to set (default NULL, which means no | * @param stop The Stopper object to set (default NULL, which means no | |||
* stopwords). | * stopwords). | |||
*/ | */ | |||
void set_stopper(const Stopper *stop = NULL); | void set_stopper(const Stopper *stop = NULL); | |||
End of changes. 2 change blocks. | ||||
11 lines changed or deleted | 17 lines changed or added | |||
termgenerator.h | termgenerator.h | |||
---|---|---|---|---|
skipping to change at line 91 | skipping to change at line 91 | |||
/// Set the database to index spelling data to. | /// Set the database to index spelling data to. | |||
void set_database(const Xapian::WritableDatabase &db); | void set_database(const Xapian::WritableDatabase &db); | |||
/// Flags to OR together and pass to TermGenerator::set_flags(). | /// Flags to OR together and pass to TermGenerator::set_flags(). | |||
enum flags { | enum flags { | |||
/// Index data required for spelling correction. | /// Index data required for spelling correction. | |||
FLAG_SPELLING = 128 // Value matches QueryParser flag. | FLAG_SPELLING = 128 // Value matches QueryParser flag. | |||
}; | }; | |||
/// Stemming strategies, for use with set_stemming_strategy(). | ||||
typedef enum { STEM_NONE, STEM_SOME, STEM_ALL, STEM_ALL_Z } stem_strate | ||||
gy; | ||||
/** Set flags. | /** Set flags. | |||
* | * | |||
* The new value of flags is: (flags & mask) ^ toggle | * The new value of flags is: (flags & mask) ^ toggle | |||
* | * | |||
* To just set the flags, pass the new flags in toggle and the | * To just set the flags, pass the new flags in toggle and the | |||
* default value for mask. | * default value for mask. | |||
* | * | |||
* @param toggle Flags to XOR. | * @param toggle Flags to XOR. | |||
* @param mask Flags to AND with first. | * @param mask Flags to AND with first. | |||
* | * | |||
* @return The old flags setting. | * @return The old flags setting. | |||
*/ | */ | |||
flags set_flags(flags toggle, flags mask = flags(0)); | flags set_flags(flags toggle, flags mask = flags(0)); | |||
/** Set the stemming strategy. | ||||
* | ||||
* This method controls how the stemming algorithm is applied. It was | ||||
* new in Xapian 1.3.1. | ||||
* | ||||
* @param strategy The strategy to use - possible values are: | ||||
* - STEM_NONE: Don't perform any stemming - only unstemmed terms | ||||
* are generated. | ||||
* - STEM_SOME: Generate both stemmed (with a "Z" prefix) and unstem | ||||
med | ||||
* terms. This is the default strategy. | ||||
* - STEM_ALL: Generate only stemmed terms (but without a "Z" prefi | ||||
x). | ||||
* - STEM_ALL_Z: Generate only stemmed terms (with a "Z" prefix). | ||||
*/ | ||||
void set_stemming_strategy(stem_strategy strategy); | ||||
/** Index some text. | /** Index some text. | |||
* | * | |||
* @param itor Utf8Iterator pointing to the text to index. | * @param itor Utf8Iterator pointing to the text to index. | |||
* @param wdf_inc The wdf increment (default 1). | * @param wdf_inc The wdf increment (default 1). | |||
* @param prefix The term prefix to use (default is no prefix). | * @param prefix The term prefix to use (default is no prefix). | |||
*/ | */ | |||
void index_text(const Xapian::Utf8Iterator & itor, | void index_text(const Xapian::Utf8Iterator & itor, | |||
Xapian::termcount wdf_inc = 1, | Xapian::termcount wdf_inc = 1, | |||
const std::string & prefix = std::string()); | const std::string & prefix = std::string()); | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 21 lines changed or added | |||
termiterator.h | termiterator.h | |||
---|---|---|---|---|
/** \file termiterator.h | /** \file termiterator.h | |||
* \brief Classes for iterating through term lists | * \brief Classes for iterating through term lists | |||
*/ | */ | |||
/* Copyright 1999,2000,2001 BrightStation PLC | /* Copyright 1999,2000,2001 BrightStation PLC | |||
* Copyright 2002 Ananova Ltd | * Copyright 2002 Ananova Ltd | |||
* Copyright 2003,2004,2005,2006,2007,2008,2009 Olly Betts | * Copyright 2003,2004,2005,2006,2007,2008,2009,2012 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 70 | skipping to change at line 70 | |||
TermIterator(const TermIterator &other); | TermIterator(const TermIterator &other); | |||
/** Assignment is allowed. The internals are reference counted, | /** Assignment is allowed. The internals are reference counted, | |||
* so assignment is also cheap. | * so assignment is also cheap. | |||
*/ | */ | |||
void operator=(const TermIterator &other); | void operator=(const TermIterator &other); | |||
/// Return the current term. | /// Return the current term. | |||
std::string operator *() const; | std::string operator *() const; | |||
/// Advance the iterator to the next position. | ||||
TermIterator & operator++(); | TermIterator & operator++(); | |||
/// Advance the iterator to the next position (postfix version). | ||||
DerefWrapper_<std::string> operator++(int) { | DerefWrapper_<std::string> operator++(int) { | |||
const std::string & term(**this); | const std::string & term(**this); | |||
operator++(); | operator++(); | |||
return DerefWrapper_<std::string>(term); | return DerefWrapper_<std::string>(term); | |||
} | } | |||
/** Advance the iterator to the specified term. | /** Advance the iterator to the specified term. | |||
* | * | |||
* If the specified term isn't in the list, position ourselves on t he | * If the specified term isn't in the list, position ourselves on t he | |||
* first term after it (or at_end() if no greater terms are present ). | * first term after it (or at_end() if no greater terms are present ). | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||
version.h | version.h | |||
---|---|---|---|---|
skipping to change at line 46 | skipping to change at line 46 | |||
#error was not compiled with this flag. The settings must match or your | #error was not compiled with this flag. The settings must match or your | |||
#error program will not work correctly. | #error program will not work correctly. | |||
#endif | #endif | |||
#endif | #endif | |||
#endif | #endif | |||
/// The library was compiled with GCC's -fvisibility=hidden option. | /// The library was compiled with GCC's -fvisibility=hidden option. | |||
#define XAPIAN_ENABLE_VISIBILITY | #define XAPIAN_ENABLE_VISIBILITY | |||
/// The version of Xapian as a C string literal. | /// The version of Xapian as a C string literal. | |||
#define XAPIAN_VERSION "1.2.10" | #define XAPIAN_VERSION "1.2.11" | |||
/** The major component of the Xapian version. | /** The major component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 1 | * E.g. for Xapian 1.0.14 this would be: 1 | |||
*/ | */ | |||
#define XAPIAN_MAJOR_VERSION 1 | #define XAPIAN_MAJOR_VERSION 1 | |||
/** The minor component of the Xapian version. | /** The minor component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 0 | * E.g. for Xapian 1.0.14 this would be: 0 | |||
*/ | */ | |||
#define XAPIAN_MINOR_VERSION 2 | #define XAPIAN_MINOR_VERSION 2 | |||
/** The revision component of the Xapian version. | /** The revision component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 14 | * E.g. for Xapian 1.0.14 this would be: 14 | |||
*/ | */ | |||
#define XAPIAN_REVISION 10 | #define XAPIAN_REVISION 11 | |||
/// XAPIAN_HAS_BRASS_BACKEND Defined if the brass backend is enabled. | /// XAPIAN_HAS_BRASS_BACKEND Defined if the brass backend is enabled. | |||
#define XAPIAN_HAS_BRASS_BACKEND 1 | #define XAPIAN_HAS_BRASS_BACKEND 1 | |||
/// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled. | /// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled. | |||
#define XAPIAN_HAS_CHERT_BACKEND 1 | #define XAPIAN_HAS_CHERT_BACKEND 1 | |||
/// XAPIAN_HAS_FLINT_BACKEND Defined if the flint backend is enabled. | /// XAPIAN_HAS_FLINT_BACKEND Defined if the flint backend is enabled. | |||
#define XAPIAN_HAS_FLINT_BACKEND 1 | #define XAPIAN_HAS_FLINT_BACKEND 1 | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
weight.h | weight.h | |||
---|---|---|---|---|
skipping to change at line 67 | skipping to change at line 67 | |||
* | * | |||
* @param flag The stat_flags value for a required statistic. | * @param flag The stat_flags value for a required statistic. | |||
*/ | */ | |||
void need_stat(stat_flags flag) { | void need_stat(stat_flags flag) { | |||
stats_needed = stat_flags(stats_needed | flag); | stats_needed = stat_flags(stats_needed | flag); | |||
} | } | |||
/** Allow the subclass to perform any initialisation it needs to. | /** Allow the subclass to perform any initialisation it needs to. | |||
* | * | |||
* @param factor Any scaling factor (e.g. from OP_SCALE_WEIGHT). | * @param factor Any scaling factor (e.g. from OP_SCALE_WEIGHT). | |||
* If the Weight object is for the term-independent | ||||
* weight supplied by get_sumextra()/get_maxextra(), | ||||
* then init(0.0) is called (starting from Xapian | ||||
* 1.2.11 and 1.3.1 - earlier versions failed to | ||||
* call init() for such Weight objects). | ||||
*/ | */ | |||
virtual void init(double factor) = 0; | virtual void init(double factor) = 0; | |||
private: | private: | |||
/// Don't allow assignment. | /// Don't allow assignment. | |||
void operator=(const Weight &); | void operator=(const Weight &); | |||
/// A bitmask of the statistics this weighting scheme needs. | /// A bitmask of the statistics this weighting scheme needs. | |||
stat_flags stats_needed; | stat_flags stats_needed; | |||
skipping to change at line 409 | skipping to change at line 414 | |||
param_b = 0; | param_b = 0; | |||
} else if (param_b > 1) { | } else if (param_b > 1) { | |||
param_b = 1; | param_b = 1; | |||
} | } | |||
need_stat(COLLECTION_SIZE); | need_stat(COLLECTION_SIZE); | |||
need_stat(RSET_SIZE); | need_stat(RSET_SIZE); | |||
need_stat(TERMFREQ); | need_stat(TERMFREQ); | |||
need_stat(RELTERMFREQ); | need_stat(RELTERMFREQ); | |||
need_stat(WDF); | need_stat(WDF); | |||
need_stat(WDF_MAX); | need_stat(WDF_MAX); | |||
need_stat(WDF); | ||||
if (param_k2 != 0 || (param_k1 != 0 && param_b != 0)) { | if (param_k2 != 0 || (param_k1 != 0 && param_b != 0)) { | |||
need_stat(DOC_LENGTH_MIN); | need_stat(DOC_LENGTH_MIN); | |||
need_stat(AVERAGE_LENGTH); | need_stat(AVERAGE_LENGTH); | |||
} | } | |||
if (param_k1 != 0 && param_b != 0) need_stat(DOC_LENGTH); | if (param_k1 != 0 && param_b != 0) need_stat(DOC_LENGTH); | |||
if (param_k2 != 0) need_stat(QUERY_LENGTH); | if (param_k2 != 0) need_stat(QUERY_LENGTH); | |||
if (param_k3 != 0) need_stat(WQF); | if (param_k3 != 0) need_stat(WQF); | |||
} | } | |||
BM25Weight() | BM25Weight() | |||
: param_k1(1), param_k2(0), param_k3(1), param_b(0.5), | : param_k1(1), param_k2(0), param_k3(1), param_b(0.5), | |||
param_min_normlen(0.5) | param_min_normlen(0.5) | |||
{ | { | |||
need_stat(COLLECTION_SIZE); | need_stat(COLLECTION_SIZE); | |||
need_stat(RSET_SIZE); | need_stat(RSET_SIZE); | |||
need_stat(TERMFREQ); | need_stat(TERMFREQ); | |||
need_stat(RELTERMFREQ); | need_stat(RELTERMFREQ); | |||
need_stat(WDF); | need_stat(WDF); | |||
need_stat(WDF_MAX); | need_stat(WDF_MAX); | |||
need_stat(WDF); | ||||
need_stat(DOC_LENGTH_MIN); | need_stat(DOC_LENGTH_MIN); | |||
need_stat(AVERAGE_LENGTH); | need_stat(AVERAGE_LENGTH); | |||
need_stat(DOC_LENGTH); | need_stat(DOC_LENGTH); | |||
need_stat(WQF); | need_stat(WQF); | |||
} | } | |||
std::string name() const; | std::string name() const; | |||
std::string serialise() const; | std::string serialise() const; | |||
BM25Weight * unserialise(const std::string & s) const; | BM25Weight * unserialise(const std::string & s) const; | |||
skipping to change at line 478 | skipping to change at line 481 | |||
TradWeight * clone() const; | TradWeight * clone() const; | |||
void init(double factor); | void init(double factor); | |||
public: | public: | |||
/** Construct a TradWeight. | /** Construct a TradWeight. | |||
* | * | |||
* @param k A non-negative parameter controlling how influential | * @param k A non-negative parameter controlling how influential | |||
* within-document-frequency (wdf) and document length are. | * within-document-frequency (wdf) and document length are. | |||
* k=0 means that wdf and document length don't affect the | * k=0 means that wdf and document length don't affect the | |||
* weights. The larger k1 is, the more they do. (default 1) | * weights. The larger k is, the more they do. (default 1) | |||
*/ | */ | |||
explicit TradWeight(double k = 1.0) : param_k(k) { | explicit TradWeight(double k = 1.0) : param_k(k) { | |||
if (param_k < 0) param_k = 0; | if (param_k < 0) param_k = 0; | |||
if (param_k != 0.0) { | if (param_k != 0.0) { | |||
need_stat(AVERAGE_LENGTH); | need_stat(AVERAGE_LENGTH); | |||
need_stat(DOC_LENGTH); | need_stat(DOC_LENGTH); | |||
} | } | |||
need_stat(COLLECTION_SIZE); | need_stat(COLLECTION_SIZE); | |||
need_stat(RSET_SIZE); | need_stat(RSET_SIZE); | |||
need_stat(TERMFREQ); | need_stat(TERMFREQ); | |||
need_stat(RELTERMFREQ); | need_stat(RELTERMFREQ); | |||
need_stat(DOC_LENGTH_MIN); | need_stat(DOC_LENGTH_MIN); | |||
need_stat(WDF); | need_stat(WDF); | |||
need_stat(WDF_MAX); | need_stat(WDF_MAX); | |||
need_stat(WDF); | ||||
} | } | |||
std::string name() const; | std::string name() const; | |||
std::string serialise() const; | std::string serialise() const; | |||
TradWeight * unserialise(const std::string & s) const; | TradWeight * unserialise(const std::string & s) const; | |||
Xapian::weight get_sumpart(Xapian::termcount wdf, | Xapian::weight get_sumpart(Xapian::termcount wdf, | |||
Xapian::termcount doclen) const; | Xapian::termcount doclen) const; | |||
Xapian::weight get_maxpart() const; | Xapian::weight get_maxpart() const; | |||
End of changes. 5 change blocks. | ||||
4 lines changed or deleted | 6 lines changed or added | |||
xapian.h | xapian.h | |||
---|---|---|---|---|
/** @file xapian.h | /** @file xapian.h | |||
* @brief Public interfaces for the Xapian library. | * @brief Public interfaces for the Xapian library. | |||
*/ | */ | |||
// Copyright (C) 2003,2004,2005,2007,2008,2009,2010 Olly Betts | // Copyright (C) 2003,2004,2005,2007,2008,2009,2010,2012 Olly Betts | |||
// | // | |||
// This program is free software; you can redistribute it and/or modify | // This program is free software; you can redistribute it and/or modify | |||
// it under the terms of the GNU General Public License as published by | // it under the terms of the GNU General Public License as published by | |||
// the Free Software Foundation; either version 2 of the License, or | // the Free Software Foundation; either version 2 of the License, or | |||
// (at your option) any later version. | // (at your option) any later version. | |||
// | // | |||
// This program is distributed in the hope that it will be useful, | // This program is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU General Public License for more details. | // GNU General Public License for more details. | |||
// | // | |||
// You should have received a copy of the GNU General Public License | // You should have received a copy of the GNU General Public License | |||
// along with this program; if not, write to the Free Software | // along with this program; if not, write to the Free Software | |||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 US A | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 US A | |||
#ifndef XAPIAN_INCLUDED_XAPIAN_H | #ifndef XAPIAN_INCLUDED_XAPIAN_H | |||
#define XAPIAN_INCLUDED_XAPIAN_H | #define XAPIAN_INCLUDED_XAPIAN_H | |||
// Qt headers '#define slots' by default, which clashes with us using it as | ||||
a | ||||
// class member name. Including <xapian.h> first is a simple workaround, o | ||||
r | ||||
// you can use 'no_keywords' to stop Qt polluting the global macro namespac | ||||
e, | ||||
// as described here: | ||||
// | ||||
// http://qt-project.org/doc/qt-5.0/signalsandslots.html#using-qt-with-3rd- | ||||
party-signals-and-slots | ||||
#if defined slots && defined Q_OBJECT | ||||
# error "Include <xapian.h> before Qt headers, or put 'CONFIG += no_keyword | ||||
s' in your .pro file and use Q_SLOTS instead of slots, etc" | ||||
#endif | ||||
// Set defines for library version and check C++ ABI versions match. | // Set defines for library version and check C++ ABI versions match. | |||
#include <xapian/version.h> | #include <xapian/version.h> | |||
// Types | // Types | |||
#include <xapian/types.h> | #include <xapian/types.h> | |||
// Exceptions | // Exceptions | |||
#include <xapian/error.h> | #include <xapian/error.h> | |||
#include <xapian/errorhandler.h> | #include <xapian/errorhandler.h> | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 16 lines changed or added | |||