*
+ * @see A Gnuplot file used to generate some of the visualizations refrenced from each function.
*/
public class SweetSpotSimilarity extends DefaultSimilarity {
@@ -75,7 +76,7 @@ public class SweetSpotSimilarity extends DefaultSimilarity {
*
* @param min the minimum tf value to ever be returned (default: 0.0)
* @param max the maximum tf value to ever be returned (default: 2.0)
- * @param base the base value to be used in the exponential for the hyperbolic function (default: e)
+ * @param base the base value to be used in the exponential for the hyperbolic function (default: 1.3)
* @param xoffset the midpoint of the hyperbolic function (default: 10.0)
* @see #hyperbolicTf
*/
@@ -135,6 +136,7 @@ public class SweetSpotSimilarity extends DefaultSimilarity {
*
*
* @see #setLengthNormFactors
+ * @see An SVG visualization of this function
*/
public float computeLengthNorm(int numTerms) {
final int l = ln_min;
@@ -175,6 +177,7 @@ public class SweetSpotSimilarity extends DefaultSimilarity {
*
*
* @see #setBaselineTfFactors
+ * @see An SVG visualization of this function
*/
public float baselineTf(float freq) {
@@ -198,6 +201,7 @@ public class SweetSpotSimilarity extends DefaultSimilarity {
*
*
* @see #setHyperbolicTfFactors
+ * @see An SVG visualization of this function
*/
public float hyperbolicTf(float freq) {
if (0.0f == freq) return 0.0f;
diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.baselineTf.svg b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.baselineTf.svg
new file mode 100644
index 00000000000..d6cbb953f86
--- /dev/null
+++ b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.baselineTf.svg
@@ -0,0 +1,208 @@
+
+
+
+
diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.computeLengthNorm.svg b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.computeLengthNorm.svg
new file mode 100644
index 00000000000..cdae3dd0249
--- /dev/null
+++ b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.computeLengthNorm.svg
@@ -0,0 +1,201 @@
+
+
+
+
diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.gnuplot b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.gnuplot
new file mode 100644
index 00000000000..68403b2e89e
--- /dev/null
+++ b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.gnuplot
@@ -0,0 +1,67 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ####################################################################
+#
+# Instructions for generating SVG renderings of the functions
+# used in SweetSpotSimilarity
+#
+# ####################################################################
+#
+#
+set terminal svg size 600,400 dynamic enhanced fname 'arial' fsize 11 butt solid
+set key inside left top vertical Right noreverse enhanced autotitles box linetype -1 linewidth 1.000
+#
+# ####### BASELINE TF
+#
+set output 'ss.baselineTf.svg'
+set title "SweetSpotSimilarity.baselineTf(x)"
+set xrange [0:20]
+set yrange [-1:8]
+btf(base,min,x)=(x <= min) ? base : sqrt(x+(base**2)-min)
+#
+plot btf(0,0,x) ti "all defaults", \
+ btf(1.5,0,x) ti "base=1.5", \
+ btf(0,5,x) ti "min=5", \
+ btf(1.5,5,x) ti "min=5, base=1.5"
+#
+# ####### HYPERBOLIC TF
+#
+set output 'ss.hyperbolicTf.svg'
+set title "SweetSpotSimilarity.hyperbolcTf(x)"
+set xrange [0:20]
+set yrange [0:3]
+htf(min,max,base,xoffset,x)=min+(max-min)/2*(((base**(x-xoffset)-base**-(x-xoffset))/(base**(x-xoffset)+base**-(x-xoffset)))+1)
+#
+plot htf(0,2,1.3,10,x) ti "all defaults", \
+ htf(0,2,1.3,5,x) ti "xoffset=5", \
+ htf(0,2,1.2,10,x) ti "base=1.2", \
+ htf(0,1.5,1.3,10,x) ti "max=1.5"
+#
+# ####### LENGTH NORM
+#
+set key inside right top
+set output 'ss.computeLengthNorm.svg'
+set title "SweetSpotSimilarity.computeLengthNorm(t)"
+set xrange [0:20]
+set yrange [0:1.2]
+set mxtics 5
+cln(min,max,steepness,x)=1/sqrt( steepness * (abs(x-min) + abs(x-max) - (max-min)) + 1 )
+#
+plot cln(1,1,0.5,x) ti "all defaults", \
+ cln(1,1,0.2,x) ti "steepness=0.2", \
+ cln(1,6,0.2,x) ti "max=6, steepness=0.2", \
+ cln(3,5,0.5,x) ti "min=3, max=5"
diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.hyperbolicTf.svg b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.hyperbolicTf.svg
new file mode 100644
index 00000000000..0f2d01c6c6e
--- /dev/null
+++ b/lucene/contrib/misc/src/java/org/apache/lucene/misc/doc-files/ss.hyperbolicTf.svg
@@ -0,0 +1,193 @@
+
+
+
+