⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classxapian_1_1weight.tex

📁 xapian 是一个“Xapian 是一个开源概率论信息检索库
💻 TEX
字号:
\hypertarget{classXapian_1_1Weight}{\section{Xapian::Weight Class Reference}\label{classXapian_1_1Weight}\index{Xapian::Weight@{Xapian::Weight}}}Abstract base class for weighting schemes.  {\tt \#include $<$enquire.h$>$}Inheritance diagram for Xapian::Weight:\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=202pt]{classXapian_1_1Weight__inherit__graph}\end{center}\end{figure}\subsection*{Public Member Functions}\begin{CompactItemize}\item \hyperlink{classXapian_1_1Weight}{Weight} $\ast$ \hyperlink{classXapian_1_1Weight_a91ea083fb86650977f1332f9b1fce51}{create} (const Internal $\ast$internal\_\-, \hyperlink{types_8h_7272583216038f810105df7dc927723c}{Xapian::doclength} querysize\_\-, \hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} wqf\_\-, std::string tname\_\-) const \begin{CompactList}\small\item\em Create a new weight object of the same type as this and initialise it with the specified statistics. \item\end{CompactList}\item virtual std::string \hyperlink{classXapian_1_1Weight_10f2a94ec786e68633012c41ecedc123}{name} () const =0\begin{CompactList}\small\item\em Name of the weighting scheme. \item\end{CompactList}\item virtual std::string \hyperlink{classXapian_1_1Weight_a395a7cb4abd4ae0a3acc8b7d2510620}{serialise} () const =0\begin{CompactList}\small\item\em Serialise object parameters into a string. \item\end{CompactList}\item virtual \hyperlink{classXapian_1_1Weight}{Weight} $\ast$ \hyperlink{classXapian_1_1Weight_c7406de40d11ffa4ef044d641a458484}{unserialise} (const std::string \&s) const =0\begin{CompactList}\small\item\em Create object given string serialisation returned by \hyperlink{classXapian_1_1Weight_a395a7cb4abd4ae0a3acc8b7d2510620}{serialise()}. \item\end{CompactList}\item virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} \hyperlink{classXapian_1_1Weight_cf94e6ef70e95adf04c70fee3f3c965b}{get\_\-sumpart} (\hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} wdf, \hyperlink{types_8h_7272583216038f810105df7dc927723c}{Xapian::doclength} len) const =0\begin{CompactList}\small\item\em Get a weight which is part of the sum over terms being performed. \item\end{CompactList}\item virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} \hyperlink{classXapian_1_1Weight_f37e797fa12bb915f73b20b953a132b7}{get\_\-maxpart} () const =0\begin{CompactList}\small\item\em Gets the maximum value that \hyperlink{classXapian_1_1Weight_cf94e6ef70e95adf04c70fee3f3c965b}{get\_\-sumpart()} may return. \item\end{CompactList}\item virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} \hyperlink{classXapian_1_1Weight_5b39302405b8d10911b26d796ba3f430}{get\_\-sumextra} (\hyperlink{types_8h_7272583216038f810105df7dc927723c}{Xapian::doclength} len) const =0\begin{CompactList}\small\item\em Get an extra weight for a document to add to the sum calculated over the query terms. \item\end{CompactList}\item virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} \hyperlink{classXapian_1_1Weight_ca641ecc2f5645666820f864d243f46d}{get\_\-maxextra} () const =0\begin{CompactList}\small\item\em Gets the maximum value that \hyperlink{classXapian_1_1Weight_5b39302405b8d10911b26d796ba3f430}{get\_\-sumextra()} may return. \item\end{CompactList}\item virtual bool \hyperlink{classXapian_1_1Weight_11a52ff08a2277bb765d579bf0ab77d8}{get\_\-sumpart\_\-needs\_\-doclength} () const \begin{CompactList}\small\item\em return false if the weight object doesn't need doclength \item\end{CompactList}\end{CompactItemize}\subsection*{Protected Member Functions}\begin{CompactItemize}\item \hypertarget{classXapian_1_1Weight_a7acc105949dcb3b8b343a598dd01487}{{\bf Weight} (const \hyperlink{classXapian_1_1Weight}{Weight} \&)}\label{classXapian_1_1Weight_a7acc105949dcb3b8b343a598dd01487}\end{CompactItemize}\subsection*{Protected Attributes}\begin{CompactItemize}\item \hypertarget{classXapian_1_1Weight_8aebcad08a0d4ea3b759828a601a2937}{const Internal $\ast$ {\bf internal}}\label{classXapian_1_1Weight_8aebcad08a0d4ea3b759828a601a2937}\item \hypertarget{classXapian_1_1Weight_45d63db7d26b581f8f82c8edd0497d1a}{\hyperlink{types_8h_7272583216038f810105df7dc927723c}{Xapian::doclength} {\bf querysize}}\label{classXapian_1_1Weight_45d63db7d26b581f8f82c8edd0497d1a}\item \hypertarget{classXapian_1_1Weight_05f45842ba5e04cecf8bb4d7c0512268}{\hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} {\bf wqf}}\label{classXapian_1_1Weight_05f45842ba5e04cecf8bb4d7c0512268}\item \hypertarget{classXapian_1_1Weight_8a78781b253210d06dfbe9f5935c5187}{std::string {\bf tname}}\label{classXapian_1_1Weight_8a78781b253210d06dfbe9f5935c5187}\end{CompactItemize}\subsection*{Friends}\begin{CompactItemize}\item \hypertarget{classXapian_1_1Weight_42749dbe9d93f195fedfb80e7dd80c12}{class {\bf Enquire}}\label{classXapian_1_1Weight_42749dbe9d93f195fedfb80e7dd80c12}\item \hypertarget{classXapian_1_1Weight_d47f53a9cdbf5eab80300744ad893cf4}{class {\bf ::Socket\-Server}}\label{classXapian_1_1Weight_d47f53a9cdbf5eab80300744ad893cf4}\end{CompactItemize}\subsection{Detailed Description}Abstract base class for weighting schemes. \subsection{Member Function Documentation}\hypertarget{classXapian_1_1Weight_a91ea083fb86650977f1332f9b1fce51}{\index{Xapian::Weight@{Xapian::Weight}!create@{create}}\index{create@{create}!Xapian::Weight@{Xapian::Weight}}\subsubsection[create]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classXapian_1_1Weight}{Weight}$\ast$ Xapian::Weight::create (const Internal $\ast$ {\em internal\_\-}, \hyperlink{types_8h_7272583216038f810105df7dc927723c}{Xapian::doclength} {\em querysize\_\-}, \hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} {\em wqf\_\-}, std::string {\em tname\_\-}) const\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}\label{classXapian_1_1Weight_a91ea083fb86650977f1332f9b1fce51}Create a new weight object of the same type as this and initialise it with the specified statistics. You shouldn't call this method yourself - it's called by \hyperlink{classXapian_1_1Enquire}{Enquire}.\begin{Desc}\item[Parameters:]\begin{description}\item[{\em internal\_\-}]Object to ask for collection statistics. \item[{\em querysize\_\-}]\hyperlink{classXapian_1_1Query}{Query} size. \item[{\em wqf\_\-}]Within query frequency of term this object is associated with. \item[{\em tname\_\-}]Term which this object is associated with. \end{description}\end{Desc}\hypertarget{classXapian_1_1Weight_ca641ecc2f5645666820f864d243f46d}{\index{Xapian::Weight@{Xapian::Weight}!get_maxextra@{get\_\-maxextra}}\index{get_maxextra@{get\_\-maxextra}!Xapian::Weight@{Xapian::Weight}}\subsubsection[get\_\-maxextra]{\setlength{\rightskip}{0pt plus 5cm}virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} Xapian::Weight::get\_\-maxextra () const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}\label{classXapian_1_1Weight_ca641ecc2f5645666820f864d243f46d}Gets the maximum value that \hyperlink{classXapian_1_1Weight_5b39302405b8d10911b26d796ba3f430}{get\_\-sumextra()} may return. This is used in optimising searches. Implemented in \hyperlink{classXapian_1_1BoolWeight_8332b9fa9cb900d273f8077f76c94fcc}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_7c91481891313e089eb38bf1a9a83029}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_5e06ecfe3f4ad59c4e1a651f604800e2}{Xapian::Trad\-Weight}.\hypertarget{classXapian_1_1Weight_f37e797fa12bb915f73b20b953a132b7}{\index{Xapian::Weight@{Xapian::Weight}!get_maxpart@{get\_\-maxpart}}\index{get_maxpart@{get\_\-maxpart}!Xapian::Weight@{Xapian::Weight}}\subsubsection[get\_\-maxpart]{\setlength{\rightskip}{0pt plus 5cm}virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} Xapian::Weight::get\_\-maxpart () const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}\label{classXapian_1_1Weight_f37e797fa12bb915f73b20b953a132b7}Gets the maximum value that \hyperlink{classXapian_1_1Weight_cf94e6ef70e95adf04c70fee3f3c965b}{get\_\-sumpart()} may return. This is used in optimising searches, by having the postlist tree decay appropriately when parts of it can have limited, or no, further effect. Implemented in \hyperlink{classXapian_1_1BoolWeight_9edd11c7c0c6d3fc72c347f1bd65bb3c}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_f23907adc06e73cdf1228fc616a2fda2}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_bc2fd38d6abbb7ef77b14959ae3f1fc0}{Xapian::Trad\-Weight}.\hypertarget{classXapian_1_1Weight_5b39302405b8d10911b26d796ba3f430}{\index{Xapian::Weight@{Xapian::Weight}!get_sumextra@{get\_\-sumextra}}\index{get_sumextra@{get\_\-sumextra}!Xapian::Weight@{Xapian::Weight}}\subsubsection[get\_\-sumextra]{\setlength{\rightskip}{0pt plus 5cm}virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} Xapian::Weight::get\_\-sumextra (\hyperlink{types_8h_7272583216038f810105df7dc927723c}{Xapian::doclength} {\em len}) const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}\label{classXapian_1_1Weight_5b39302405b8d10911b26d796ba3f430}Get an extra weight for a document to add to the sum calculated over the query terms. This returns a weight for a given document, and is used by some weighting schemes to account for influence such as document length.\begin{Desc}\item[Parameters:]\begin{description}\item[{\em len}]the (unnormalised) document length. \end{description}\end{Desc}Implemented in \hyperlink{classXapian_1_1BoolWeight_5ec8d8a951450a758d9b5ea74fefcb09}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_85644662b31656561181f26fc4e3b190}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_6602159c73f926a5c717af04d53b4c18}{Xapian::Trad\-Weight}.\hypertarget{classXapian_1_1Weight_cf94e6ef70e95adf04c70fee3f3c965b}{\index{Xapian::Weight@{Xapian::Weight}!get_sumpart@{get\_\-sumpart}}\index{get_sumpart@{get\_\-sumpart}!Xapian::Weight@{Xapian::Weight}}\subsubsection[get\_\-sumpart]{\setlength{\rightskip}{0pt plus 5cm}virtual \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} Xapian::Weight::get\_\-sumpart (\hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} {\em wdf}, \hyperlink{types_8h_7272583216038f810105df7dc927723c}{Xapian::doclength} {\em len}) const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}\label{classXapian_1_1Weight_cf94e6ef70e95adf04c70fee3f3c965b}Get a weight which is part of the sum over terms being performed. This returns a weight for a given term and document. These weights are summed to give a total weight for the document.\begin{Desc}\item[Parameters:]\begin{description}\item[{\em wdf}]the within document frequency of the term. \item[{\em len}]the (unnormalised) document length. \end{description}\end{Desc}Implemented in \hyperlink{classXapian_1_1BoolWeight_24a1cbfea74c21c0b7db6bd54d3d2028}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_6fc34658a0e0bbf6904cbef7161ba3b0}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_baf2e363758436ec0df6be1120196cfe}{Xapian::Trad\-Weight}.\hypertarget{classXapian_1_1Weight_11a52ff08a2277bb765d579bf0ab77d8}{\index{Xapian::Weight@{Xapian::Weight}!get_sumpart_needs_doclength@{get\_\-sumpart\_\-needs\_\-doclength}}\index{get_sumpart_needs_doclength@{get\_\-sumpart\_\-needs\_\-doclength}!Xapian::Weight@{Xapian::Weight}}\subsubsection[get\_\-sumpart\_\-needs\_\-doclength]{\setlength{\rightskip}{0pt plus 5cm}virtual bool Xapian::Weight::get\_\-sumpart\_\-needs\_\-doclength () const\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}\label{classXapian_1_1Weight_11a52ff08a2277bb765d579bf0ab77d8}return false if the weight object doesn't need doclength Reimplemented in \hyperlink{classXapian_1_1BoolWeight_6509a1b0a46dc2e37dcbd786626de8e6}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_0c54cede890ff405245757615d7bc651}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_183bfaab8cf24df3f43982c447b62f7a}{Xapian::Trad\-Weight}.\hypertarget{classXapian_1_1Weight_10f2a94ec786e68633012c41ecedc123}{\index{Xapian::Weight@{Xapian::Weight}!name@{name}}\index{name@{name}!Xapian::Weight@{Xapian::Weight}}\subsubsection[name]{\setlength{\rightskip}{0pt plus 5cm}virtual std::string Xapian::Weight::name () const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}\label{classXapian_1_1Weight_10f2a94ec786e68633012c41ecedc123}Name of the weighting scheme. If the subclass is called Foo\-Weight, this should return \char`\"{}Foo\char`\"{}. Implemented in \hyperlink{classXapian_1_1BoolWeight_c91b3673317ee9574dff4321482f579d}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_943fdc83495a97f7d6af1208f5b26052}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_a34538148bb8a2771675117d7331aee1}{Xapian::Trad\-Weight}.\hypertarget{classXapian_1_1Weight_a395a7cb4abd4ae0a3acc8b7d2510620}{\index{Xapian::Weight@{Xapian::Weight}!serialise@{serialise}}\index{serialise@{serialise}!Xapian::Weight@{Xapian::Weight}}\subsubsection[serialise]{\setlength{\rightskip}{0pt plus 5cm}virtual std::string Xapian::Weight::serialise () const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}\label{classXapian_1_1Weight_a395a7cb4abd4ae0a3acc8b7d2510620}Serialise object parameters into a string. Implemented in \hyperlink{classXapian_1_1BoolWeight_06e88787161cc2146511259d5742dd10}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_2dd2eb60deb5690e471d68f4c7fc3203}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_3cb90ec9c8ef2866dfa405d3490d4cc3}{Xapian::Trad\-Weight}.\hypertarget{classXapian_1_1Weight_c7406de40d11ffa4ef044d641a458484}{\index{Xapian::Weight@{Xapian::Weight}!unserialise@{unserialise}}\index{unserialise@{unserialise}!Xapian::Weight@{Xapian::Weight}}\subsubsection[unserialise]{\setlength{\rightskip}{0pt plus 5cm}virtual \hyperlink{classXapian_1_1Weight}{Weight}$\ast$ Xapian::Weight::unserialise (const std::string \& {\em s}) const\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}\label{classXapian_1_1Weight_c7406de40d11ffa4ef044d641a458484}Create object given string serialisation returned by \hyperlink{classXapian_1_1Weight_a395a7cb4abd4ae0a3acc8b7d2510620}{serialise()}. Implemented in \hyperlink{classXapian_1_1BoolWeight_563504a9f0a55ad298ca23ecb588b88e}{Xapian::Bool\-Weight}, \hyperlink{classXapian_1_1BM25Weight_8a9f0c48f4229aa0d62feff5f496dc78}{Xapian::BM25Weight}, and \hyperlink{classXapian_1_1TradWeight_ce5aae016fc57407c7f7f5f0f3d7b5c0}{Xapian::Trad\-Weight}.The documentation for this class was generated from the following file:\begin{CompactItemize}\item include/xapian/\hyperlink{enquire_8h}{enquire.h}\end{CompactItemize}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -