00001 00002 /*========================================================================== 00003 * Copyright (c) 2001 Carnegie Mellon University. All Rights Reserved. 00004 * 00005 * Use of the Lemur Toolkit for Language Modeling and Information Retrieval 00006 * is subject to the terms of the software license set forth in the LICENSE 00007 * file included with this software, and also available at 00008 * http://www.lemurproject.org/license.html 00009 * 00010 *========================================================================== 00011 */ 00012 00013 00014 #ifndef _SCOREFUNCTION_HPP 00015 #define _SCOREFUNCTION_HPP 00016 00017 #include "TextQueryRep.hpp" 00018 #include "DocumentRep.hpp" 00019 00020 //------------------------------------------------------------ 00021 // Abstract Interface for Inverted index based Retrieval Function 00022 //------------------------------------------------------------ 00023 00025 00034 class ScoreFunction { 00035 public: 00037 virtual double matchedTermWeight(const QueryTerm *qTerm, const TextQueryRep *qRep, const DocInfo *info, const DocumentRep *dRep) const { 00038 return (qTerm->weight()*dRep->termWeight(qTerm->id(),info)); 00039 } 00040 00042 virtual double adjustedScore(double origScore, const TextQueryRep *qRep, const DocumentRep *dRep) const { 00043 return origScore; 00044 } 00045 }; 00046 00047 00048 00049 #endif /* _SCOREFUNCTION_HPP */ 00050 00051