diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-11-05 13:28:23 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-11-05 13:28:23 +0100 |
commit | 8c787c3591c1c885b91a54128835b400858c5cca (patch) | |
tree | eca1b776912a305c4d45b3964038278a2fae1ead /debian/htdig/htdig-3.2.0b6/htsearch/HtURLSeedScore.h | |
parent | fe188b907cdf30dfdfe0eba9412e7f8749fec158 (diff) | |
download | extra-dependencies-8c787c3591c1c885b91a54128835b400858c5cca.tar.gz extra-dependencies-8c787c3591c1c885b91a54128835b400858c5cca.zip |
DEB htdig: Added to repository.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'debian/htdig/htdig-3.2.0b6/htsearch/HtURLSeedScore.h')
-rw-r--r-- | debian/htdig/htdig-3.2.0b6/htsearch/HtURLSeedScore.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/debian/htdig/htdig-3.2.0b6/htsearch/HtURLSeedScore.h b/debian/htdig/htdig-3.2.0b6/htsearch/HtURLSeedScore.h new file mode 100644 index 00000000..49f8e64e --- /dev/null +++ b/debian/htdig/htdig-3.2.0b6/htsearch/HtURLSeedScore.h @@ -0,0 +1,55 @@ +// +// HtURLSeedScore.h +// +// URLSeedScore: Constructed from a Configuration, see doc +// for format of config item "url_seed_score". +// Method "double adjust_score(double score, const String &url)" +// returns an adjusted score, given the original score, or returns the +// original score if there was no adjustment to do. +// +// $Id: HtURLSeedScore.h,v 1.4 2004/05/28 13:15:24 lha Exp $ +// +// Part of the ht://Dig package <http://www.htdig.org/> +// Copyright (c) 2000-2004 The ht://Dig Group +// For copyright details, see the file COPYING in your distribution +// or the GNU Library General Public License (LGPL) version 2 or later +// <http://www.gnu.org/copyleft/lgpl.html> +// +#ifndef __HtURLSeedScore_h +#define __HtURLSeedScore_h + +#include "Configuration.h" +#include "List.h" + +class URLSeedScore +{ +public: + URLSeedScore(Configuration &); + ~URLSeedScore(); + + // Return the "adjusted" score. Use an inline method to avoid + // function-call overhead when this feature is unused. + double adjust_score(double score, const String& url) + { + return myAdjustmentList->Count() == 0 + ? score : noninline_adjust_score(score, url); + } + + // If an error was discovered during the parsing of + // the configuration, this member gives a + // nonempty String with an error message. + const String& ErrMsg() { return myErrMsg; } + +private: + double noninline_adjust_score(double score, const String& url); + + // These member functions are not supposed to be implemented. + URLSeedScore(); + URLSeedScore(const URLSeedScore &); + void operator= (const URLSeedScore &); + + List *myAdjustmentList; + String myErrMsg; +}; + +#endif /* __HtURLSeedScore_h */ |