sweetspotsimilarity.html
来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 515 行 · 第 1/2 页
HTML
515 行
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="SweetSpotSimilarity()"><!-- --></A><H3>
SweetSpotSimilarity</H3>
<PRE>
public <B>SweetSpotSimilarity</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="setBaselineTfFactors(float, float)"><!-- --></A><H3>
setBaselineTfFactors</H3>
<PRE>
public void <B>setBaselineTfFactors</B>(float base, float min)</PRE>
<DL>
<DD>Sets the baseline and minimum function variables for baselineTf
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#baselineTf(float)"><CODE>baselineTf(float)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setHyperbolicTfFactors(float, float, double, float)"><!-- --></A><H3>
setHyperbolicTfFactors</H3>
<PRE>
public void <B>setHyperbolicTfFactors</B>(float min, float max, double base, float xoffset)</PRE>
<DL>
<DD>Sets the function variables for the hyperbolicTf functions
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>min</CODE> - the minimum tf value to ever be returned (default: 0.0)<DD><CODE>max</CODE> - the maximum tf value to ever be returned (default: 2.0)<DD><CODE>base</CODE> - the base value to be used in the exponential for the hyperbolic function (default: e)<DD><CODE>xoffset</CODE> - the midpoint of the hyperbolic function (default: 10.0)<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#hyperbolicTf(float)"><CODE>hyperbolicTf(float)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setLengthNormFactors(int, int, float)"><!-- --></A><H3>
setLengthNormFactors</H3>
<PRE>
public void <B>setLengthNormFactors</B>(int min, int max, float steepness)</PRE>
<DL>
<DD>Sets the default function variables used by lengthNorm when no field specifc variables have been set.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#lengthNorm(java.lang.String, int)"><CODE>lengthNorm(java.lang.String, int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setLengthNormFactors(java.lang.String, int, int, float)"><!-- --></A><H3>
setLengthNormFactors</H3>
<PRE>
public void <B>setLengthNormFactors</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> field, int min, int max, float steepness)</PRE>
<DL>
<DD>Sets the function variables used by lengthNorm for a specific named field
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#lengthNorm(java.lang.String, int)"><CODE>lengthNorm(java.lang.String, int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="lengthNorm(java.lang.String, int)"><!-- --></A><H3>
lengthNorm</H3>
<PRE>
public float <B>lengthNorm</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> fieldName, int numTerms)</PRE>
<DL>
<DD>Implimented as: <code> 1/sqrt( steepness * (abs(x-min) + abs(x-max) - (max-min)) + 1 ) </code> <p> This degrades to <code>1/sqrt(x)</code> when min and max are both 1 and steepness is 0.5 </p> <p> :TODO: potential optimiation is to just flat out return 1.0f if numTerms is between min and max. </p>
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/DefaultSimilarity.html#lengthNorm(java.lang.String, int)">lengthNorm</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/DefaultSimilarity.html" title="class in org.apache.lucene.search">DefaultSimilarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#setLengthNormFactors(int, int, float)"><CODE>setLengthNormFactors(int, int, float)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="tf(int)"><!-- --></A><H3>
tf</H3>
<PRE>
public float <B>tf</B>(int freq)</PRE>
<DL>
<DD>Delegates to baselineTf
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html#tf(int)">tf</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>freq</CODE> - the frequency of a term within a document<DT><B>Returns:</B><DD>a score factor based on a term's within-document frequency<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#baselineTf(float)"><CODE>baselineTf(float)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="baselineTf(float)"><!-- --></A><H3>
baselineTf</H3>
<PRE>
public float <B>baselineTf</B>(float freq)</PRE>
<DL>
<DD>Implimented as: <code> (x <= min) ? base : sqrt(x+(base**2)-min) </code> ...but with a special case check for 0. <p> This degrates to <code>sqrt(x)</code> when min and base are both 0 </p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#setBaselineTfFactors(float, float)"><CODE>setBaselineTfFactors(float, float)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="hyperbolicTf(float)"><!-- --></A><H3>
hyperbolicTf</H3>
<PRE>
public float <B>hyperbolicTf</B>(float freq)</PRE>
<DL>
<DD>Uses a hyperbolic tangent function that allows for a hard max... <code> tf(x)=min+(max-min)/2*(((base**(x-xoffset)-base**-(x-xoffset))/(base**(x-xoffset)+base**-(x-xoffset)))+1) </code> <p> This code is provided as a convincience for subclasses that want to use a hyperbolic tf function. </p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/misc/SweetSpotSimilarity.html#setHyperbolicTfFactors(float, float, double, float)"><CODE>setHyperbolicTfFactors(float, float, double, float)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SweetSpotSimilarity.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/apache/lucene/misc/LengthNormModifier.html" title="class in org.apache.lucene.misc"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="SweetSpotSimilarity.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?