commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r949214 [15/35] - in /websites/production/commons/content/sandbox/commons-text: ./ apidocs/ apidocs/org/apache/commons/text/diff/ apidocs/org/apache/commons/text/diff/class-use/ apidocs/org/apache/commons/text/names/ apidocs/org/apache/comm...
Date Sun, 26 Apr 2015 10:18:28 GMT
Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/CosineSimilarity.html
==============================================================================
--- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/CosineSimilarity.html (original)
+++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/CosineSimilarity.html Sun Apr 26 10:18:25 2015
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+<html lang="de">
 <head>
 <title>Source code</title>
 <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
@@ -36,77 +36,75 @@
 <span class="sourceLineNo">028</span> * For further explanation about the Cosine Similarity, refer to<a name="line.28"></a>
 <span class="sourceLineNo">029</span> * http://en.wikipedia.org/wiki/Cosine_similarity.<a name="line.29"></a>
 <span class="sourceLineNo">030</span> * &lt;/p&gt;<a name="line.30"></a>
-<span class="sourceLineNo">031</span> *<a name="line.31"></a>
-<span class="sourceLineNo">032</span> * @since 1.0<a name="line.32"></a>
-<span class="sourceLineNo">033</span> */<a name="line.33"></a>
-<span class="sourceLineNo">034</span>public class CosineSimilarity {<a name="line.34"></a>
-<span class="sourceLineNo">035</span><a name="line.35"></a>
-<span class="sourceLineNo">036</span>    /**<a name="line.36"></a>
-<span class="sourceLineNo">037</span>     * Calculates the cosine similarity for two given vectors.<a name="line.37"></a>
-<span class="sourceLineNo">038</span>     *<a name="line.38"></a>
-<span class="sourceLineNo">039</span>     * @param leftVector left vector<a name="line.39"></a>
-<span class="sourceLineNo">040</span>     * @param rightVector right vector<a name="line.40"></a>
-<span class="sourceLineNo">041</span>     * @return cosine similarity between the two vectors<a name="line.41"></a>
-<span class="sourceLineNo">042</span>     */<a name="line.42"></a>
-<span class="sourceLineNo">043</span>    public Double cosineSimilarity(Map&lt;CharSequence, Integer&gt; leftVector, Map&lt;CharSequence, Integer&gt; rightVector) {<a name="line.43"></a>
-<span class="sourceLineNo">044</span>        if (leftVector == null || rightVector == null) {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>            throw new IllegalArgumentException("Vectors must not be null");<a name="line.45"></a>
-<span class="sourceLineNo">046</span>        }<a name="line.46"></a>
+<span class="sourceLineNo">031</span> */<a name="line.31"></a>
+<span class="sourceLineNo">032</span>public class CosineSimilarity {<a name="line.32"></a>
+<span class="sourceLineNo">033</span><a name="line.33"></a>
+<span class="sourceLineNo">034</span>    /**<a name="line.34"></a>
+<span class="sourceLineNo">035</span>     * Calculates the cosine similarity for two given vectors.<a name="line.35"></a>
+<span class="sourceLineNo">036</span>     *<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     * @param leftVector left vector<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     * @param rightVector right vector<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     * @return cosine similarity between the two vectors<a name="line.39"></a>
+<span class="sourceLineNo">040</span>     */<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    public Double cosineSimilarity(Map&lt;CharSequence, Integer&gt; leftVector, Map&lt;CharSequence, Integer&gt; rightVector) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>        if (leftVector == null || rightVector == null) {<a name="line.42"></a>
+<span class="sourceLineNo">043</span>            throw new IllegalArgumentException("Vectors must not be null");<a name="line.43"></a>
+<span class="sourceLineNo">044</span>        }<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>        Set&lt;CharSequence&gt; intersection = getIntersection(leftVector, rightVector);<a name="line.46"></a>
 <span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>        Set&lt;CharSequence&gt; intersection = getIntersection(leftVector, rightVector);<a name="line.48"></a>
-<span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span>        double dotProduct = dot(leftVector, rightVector, intersection);<a name="line.50"></a>
-<span class="sourceLineNo">051</span>        double d1 = 0.0d;<a name="line.51"></a>
-<span class="sourceLineNo">052</span>        for (Integer value : leftVector.values()) {<a name="line.52"></a>
-<span class="sourceLineNo">053</span>            d1 += Math.pow(value, 2);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>        }<a name="line.54"></a>
-<span class="sourceLineNo">055</span>        double d2 = 0.0d;<a name="line.55"></a>
-<span class="sourceLineNo">056</span>        for (Integer value : rightVector.values()) {<a name="line.56"></a>
-<span class="sourceLineNo">057</span>            d2 += Math.pow(value, 2);<a name="line.57"></a>
-<span class="sourceLineNo">058</span>        }<a name="line.58"></a>
-<span class="sourceLineNo">059</span>        double cosineSimilarity;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>        if (d1 &lt;= 0.0 || d2 &lt;= 0.0) {<a name="line.60"></a>
-<span class="sourceLineNo">061</span>            cosineSimilarity = 0.0;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>        } else {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>            cosineSimilarity = (double) (dotProduct / (double) (Math.sqrt(d1) * Math.sqrt(d2)));<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        }<a name="line.64"></a>
-<span class="sourceLineNo">065</span>        return cosineSimilarity;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    }<a name="line.66"></a>
-<span class="sourceLineNo">067</span><a name="line.67"></a>
-<span class="sourceLineNo">068</span>    /**<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * Returns a set with strings common to the two given maps.<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     *<a name="line.70"></a>
-<span class="sourceLineNo">071</span>     * @param leftVector left vector map<a name="line.71"></a>
-<span class="sourceLineNo">072</span>     * @param rightVector right vector map<a name="line.72"></a>
-<span class="sourceLineNo">073</span>     * @return common strings<a name="line.73"></a>
-<span class="sourceLineNo">074</span>     */<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    private Set&lt;CharSequence&gt; getIntersection(Map&lt;CharSequence, Integer&gt; leftVector,<a name="line.75"></a>
-<span class="sourceLineNo">076</span>            Map&lt;CharSequence, Integer&gt; rightVector) {<a name="line.76"></a>
-<span class="sourceLineNo">077</span>        Set&lt;CharSequence&gt; intersection = new HashSet&lt;CharSequence&gt;(leftVector.keySet());<a name="line.77"></a>
-<span class="sourceLineNo">078</span>        intersection.retainAll(rightVector.keySet());<a name="line.78"></a>
-<span class="sourceLineNo">079</span>        return intersection;<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    }<a name="line.80"></a>
-<span class="sourceLineNo">081</span><a name="line.81"></a>
-<span class="sourceLineNo">082</span>    /**<a name="line.82"></a>
-<span class="sourceLineNo">083</span>     * Computes the dot product of two vectors. It ignores remaining elements. It means<a name="line.83"></a>
-<span class="sourceLineNo">084</span>     * that if a vector is longer than other, then a smaller part of it will be used to compute<a name="line.84"></a>
-<span class="sourceLineNo">085</span>     * the dot product.<a name="line.85"></a>
-<span class="sourceLineNo">086</span>     *<a name="line.86"></a>
-<span class="sourceLineNo">087</span>     * @param leftVector left vector<a name="line.87"></a>
-<span class="sourceLineNo">088</span>     * @param rightVector right vector<a name="line.88"></a>
-<span class="sourceLineNo">089</span>     * @param intersection common elements<a name="line.89"></a>
-<span class="sourceLineNo">090</span>     * @return the dot product<a name="line.90"></a>
-<span class="sourceLineNo">091</span>     */<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    private double dot(Map&lt;CharSequence, Integer&gt; leftVector, Map&lt;CharSequence, Integer&gt; rightVector,<a name="line.92"></a>
-<span class="sourceLineNo">093</span>            Set&lt;CharSequence&gt; intersection) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>        long dotProduct = 0;<a name="line.94"></a>
-<span class="sourceLineNo">095</span>        for (CharSequence key : intersection) {<a name="line.95"></a>
-<span class="sourceLineNo">096</span>            dotProduct += leftVector.get(key) * rightVector.get(key);<a name="line.96"></a>
-<span class="sourceLineNo">097</span>        }<a name="line.97"></a>
-<span class="sourceLineNo">098</span>        return dotProduct;<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    }<a name="line.99"></a>
-<span class="sourceLineNo">100</span><a name="line.100"></a>
-<span class="sourceLineNo">101</span>}<a name="line.101"></a>
+<span class="sourceLineNo">048</span>        double dotProduct = dot(leftVector, rightVector, intersection);<a name="line.48"></a>
+<span class="sourceLineNo">049</span>        double d1 = 0.0d;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>        for (Integer value : leftVector.values()) {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>            d1 += Math.pow(value, 2);<a name="line.51"></a>
+<span class="sourceLineNo">052</span>        }<a name="line.52"></a>
+<span class="sourceLineNo">053</span>        double d2 = 0.0d;<a name="line.53"></a>
+<span class="sourceLineNo">054</span>        for (Integer value : rightVector.values()) {<a name="line.54"></a>
+<span class="sourceLineNo">055</span>            d2 += Math.pow(value, 2);<a name="line.55"></a>
+<span class="sourceLineNo">056</span>        }<a name="line.56"></a>
+<span class="sourceLineNo">057</span>        double cosineSimilarity;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>        if (d1 &lt;= 0.0 || d2 &lt;= 0.0) {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>            cosineSimilarity = 0.0;<a name="line.59"></a>
+<span class="sourceLineNo">060</span>        } else {<a name="line.60"></a>
+<span class="sourceLineNo">061</span>            cosineSimilarity = (double) (dotProduct / (double) (Math.sqrt(d1) * Math.sqrt(d2)));<a name="line.61"></a>
+<span class="sourceLineNo">062</span>        }<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        return cosineSimilarity;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    }<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>    /**<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * Returns a set with strings common to the two given maps.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     *<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * @param leftVector left vector map<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * @param rightVector right vector map<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     * @return common strings<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     */<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    private Set&lt;CharSequence&gt; getIntersection(Map&lt;CharSequence, Integer&gt; leftVector,<a name="line.73"></a>
+<span class="sourceLineNo">074</span>            Map&lt;CharSequence, Integer&gt; rightVector) {<a name="line.74"></a>
+<span class="sourceLineNo">075</span>        Set&lt;CharSequence&gt; intersection = new HashSet&lt;CharSequence&gt;(leftVector.keySet());<a name="line.75"></a>
+<span class="sourceLineNo">076</span>        intersection.retainAll(rightVector.keySet());<a name="line.76"></a>
+<span class="sourceLineNo">077</span>        return intersection;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    }<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>    /**<a name="line.80"></a>
+<span class="sourceLineNo">081</span>     * Computes the dot product of two vectors. It ignores remaining elements. It means<a name="line.81"></a>
+<span class="sourceLineNo">082</span>     * that if a vector is longer than other, then a smaller part of it will be used to compute<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     * the dot product.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     *<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     * @param leftVector left vector<a name="line.85"></a>
+<span class="sourceLineNo">086</span>     * @param rightVector right vector<a name="line.86"></a>
+<span class="sourceLineNo">087</span>     * @param intersection common elements<a name="line.87"></a>
+<span class="sourceLineNo">088</span>     * @return the dot product<a name="line.88"></a>
+<span class="sourceLineNo">089</span>     */<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    private double dot(Map&lt;CharSequence, Integer&gt; leftVector, Map&lt;CharSequence, Integer&gt; rightVector,<a name="line.90"></a>
+<span class="sourceLineNo">091</span>            Set&lt;CharSequence&gt; intersection) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>        long dotProduct = 0;<a name="line.92"></a>
+<span class="sourceLineNo">093</span>        for (CharSequence key : intersection) {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>            dotProduct += leftVector.get(key) * rightVector.get(key);<a name="line.94"></a>
+<span class="sourceLineNo">095</span>        }<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        return dotProduct;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    }<a name="line.97"></a>
+<span class="sourceLineNo">098</span><a name="line.98"></a>
+<span class="sourceLineNo">099</span>}<a name="line.99"></a>
 
 
 
@@ -170,4 +168,4 @@
 </pre>
 </div>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/EditDistance.html
==============================================================================
--- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/EditDistance.html (original)
+++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/EditDistance.html Sun Apr 26 10:18:25 2015
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+<html lang="de">
 <head>
 <title>Source code</title>
 <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
@@ -40,20 +40,19 @@
 <span class="sourceLineNo">032</span> * &lt;/p&gt;<a name="line.32"></a>
 <span class="sourceLineNo">033</span> *<a name="line.33"></a>
 <span class="sourceLineNo">034</span> * @param &lt;R&gt; The type of similarity score unit used by this EditDistance.<a name="line.34"></a>
-<span class="sourceLineNo">035</span> * @since 1.0<a name="line.35"></a>
-<span class="sourceLineNo">036</span> */<a name="line.36"></a>
-<span class="sourceLineNo">037</span>public interface EditDistance&lt;R&gt; {<a name="line.37"></a>
-<span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>    /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>     * Compares two CharSequences.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>     *<a name="line.41"></a>
-<span class="sourceLineNo">042</span>     * @param left the first CharSequence<a name="line.42"></a>
-<span class="sourceLineNo">043</span>     * @param right the second CharSequence<a name="line.43"></a>
-<span class="sourceLineNo">044</span>     * @return the similarity score between two CharSequences<a name="line.44"></a>
-<span class="sourceLineNo">045</span>     */<a name="line.45"></a>
-<span class="sourceLineNo">046</span>    R apply(CharSequence left, CharSequence right);<a name="line.46"></a>
-<span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>}<a name="line.48"></a>
+<span class="sourceLineNo">035</span> */<a name="line.35"></a>
+<span class="sourceLineNo">036</span>public interface EditDistance&lt;R&gt; {<a name="line.36"></a>
+<span class="sourceLineNo">037</span><a name="line.37"></a>
+<span class="sourceLineNo">038</span>    /**<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     * Compares two CharSequences.<a name="line.39"></a>
+<span class="sourceLineNo">040</span>     *<a name="line.40"></a>
+<span class="sourceLineNo">041</span>     * @param left the first CharSequence<a name="line.41"></a>
+<span class="sourceLineNo">042</span>     * @param right the second CharSequence<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     * @return the similarity score between two CharSequences<a name="line.43"></a>
+<span class="sourceLineNo">044</span>     */<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    R apply(CharSequence left, CharSequence right);<a name="line.45"></a>
+<span class="sourceLineNo">046</span><a name="line.46"></a>
+<span class="sourceLineNo">047</span>}<a name="line.47"></a>
 
 
 
@@ -117,4 +116,4 @@
 </pre>
 </div>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/EditDistanceFrom.html
==============================================================================
--- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/EditDistanceFrom.html (original)
+++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/EditDistanceFrom.html Sun Apr 26 10:18:25 2015
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+<html lang="de">
 <head>
 <title>Source code</title>
 <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
@@ -56,68 +56,67 @@
 <span class="sourceLineNo">048</span> * &lt;/pre&gt;<a name="line.48"></a>
 <span class="sourceLineNo">049</span> *<a name="line.49"></a>
 <span class="sourceLineNo">050</span> * @param &lt;R&gt; This is the type of similarity score used by the EditDistance function.<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * @since 1.0<a name="line.51"></a>
-<span class="sourceLineNo">052</span> */<a name="line.52"></a>
-<span class="sourceLineNo">053</span>public class EditDistanceFrom&lt;R&gt; {<a name="line.53"></a>
-<span class="sourceLineNo">054</span><a name="line.54"></a>
-<span class="sourceLineNo">055</span>    /**<a name="line.55"></a>
-<span class="sourceLineNo">056</span>     * Edit distance.<a name="line.56"></a>
-<span class="sourceLineNo">057</span>     */<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    private final EditDistance&lt;R&gt; editDistance;<a name="line.58"></a>
-<span class="sourceLineNo">059</span>    /**<a name="line.59"></a>
-<span class="sourceLineNo">060</span>     * Left parameter used in distance function.<a name="line.60"></a>
-<span class="sourceLineNo">061</span>     */<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    private final CharSequence left;<a name="line.62"></a>
-<span class="sourceLineNo">063</span><a name="line.63"></a>
-<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
-<span class="sourceLineNo">065</span>     * &lt;p&gt;This accepts the edit distance implementation and the "left" string.&lt;/p&gt;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>     *<a name="line.66"></a>
-<span class="sourceLineNo">067</span>     * @param editDistance This may not be null.<a name="line.67"></a>
-<span class="sourceLineNo">068</span>     * @param left This may be null here,<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     *             but the EditDistance#compare(CharSequence left, CharSequence right)<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     *             implementation may not accept nulls.<a name="line.70"></a>
-<span class="sourceLineNo">071</span>     */<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    public EditDistanceFrom(final EditDistance&lt;R&gt; editDistance, final CharSequence left) {<a name="line.72"></a>
-<span class="sourceLineNo">073</span>        if (editDistance == null) {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>            throw new IllegalArgumentException("The edit distance may not be null.");<a name="line.74"></a>
-<span class="sourceLineNo">075</span>        }<a name="line.75"></a>
-<span class="sourceLineNo">076</span><a name="line.76"></a>
-<span class="sourceLineNo">077</span>        this.editDistance = editDistance;<a name="line.77"></a>
-<span class="sourceLineNo">078</span>        this.left = left;<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    }<a name="line.79"></a>
-<span class="sourceLineNo">080</span><a name="line.80"></a>
-<span class="sourceLineNo">081</span>    /**<a name="line.81"></a>
-<span class="sourceLineNo">082</span>     * &lt;p&gt;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>     * This compares "left" field against the "right" parameter<a name="line.83"></a>
-<span class="sourceLineNo">084</span>     * using the "edit distance" implementation.<a name="line.84"></a>
-<span class="sourceLineNo">085</span>     * &lt;/p&gt;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>     *<a name="line.86"></a>
-<span class="sourceLineNo">087</span>     * @param right the second CharSequence<a name="line.87"></a>
-<span class="sourceLineNo">088</span>     * @return the similarity score between two CharSequences<a name="line.88"></a>
-<span class="sourceLineNo">089</span>     */<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    public R apply(CharSequence right) {<a name="line.90"></a>
-<span class="sourceLineNo">091</span>        return editDistance.apply(left, right);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    }<a name="line.92"></a>
-<span class="sourceLineNo">093</span><a name="line.93"></a>
-<span class="sourceLineNo">094</span>    /**<a name="line.94"></a>
-<span class="sourceLineNo">095</span>     * Gets the left parameter.<a name="line.95"></a>
-<span class="sourceLineNo">096</span>     *<a name="line.96"></a>
-<span class="sourceLineNo">097</span>     * @return the left parameter<a name="line.97"></a>
-<span class="sourceLineNo">098</span>     */<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    public CharSequence getLeft() {<a name="line.99"></a>
-<span class="sourceLineNo">100</span>        return left;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>    }<a name="line.101"></a>
-<span class="sourceLineNo">102</span><a name="line.102"></a>
-<span class="sourceLineNo">103</span>    /**<a name="line.103"></a>
-<span class="sourceLineNo">104</span>     * Gets the edit distance.<a name="line.104"></a>
-<span class="sourceLineNo">105</span>     *<a name="line.105"></a>
-<span class="sourceLineNo">106</span>     * @return the edit distance<a name="line.106"></a>
-<span class="sourceLineNo">107</span>     */<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    public EditDistance&lt;R&gt; getEditDistance() {<a name="line.108"></a>
-<span class="sourceLineNo">109</span>        return editDistance;<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    }<a name="line.110"></a>
-<span class="sourceLineNo">111</span><a name="line.111"></a>
-<span class="sourceLineNo">112</span>}<a name="line.112"></a>
+<span class="sourceLineNo">051</span> */<a name="line.51"></a>
+<span class="sourceLineNo">052</span>public class EditDistanceFrom&lt;R&gt; {<a name="line.52"></a>
+<span class="sourceLineNo">053</span><a name="line.53"></a>
+<span class="sourceLineNo">054</span>    /**<a name="line.54"></a>
+<span class="sourceLineNo">055</span>     * Edit distance.<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     */<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    private final EditDistance&lt;R&gt; editDistance;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    /**<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * Left parameter used in distance function.<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     */<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    private final CharSequence left;<a name="line.61"></a>
+<span class="sourceLineNo">062</span><a name="line.62"></a>
+<span class="sourceLineNo">063</span>    /**<a name="line.63"></a>
+<span class="sourceLineNo">064</span>     * &lt;p&gt;This accepts the edit distance implementation and the "left" string.&lt;/p&gt;<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     *<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     * @param editDistance This may not be null.<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * @param left This may be null here,<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     *             but the EditDistance#compare(CharSequence left, CharSequence right)<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     *             implementation may not accept nulls.<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     */<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    public EditDistanceFrom(final EditDistance&lt;R&gt; editDistance, final CharSequence left) {<a name="line.71"></a>
+<span class="sourceLineNo">072</span>        if (editDistance == null) {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>            throw new IllegalArgumentException("The edit distance may not be null.");<a name="line.73"></a>
+<span class="sourceLineNo">074</span>        }<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>        this.editDistance = editDistance;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>        this.left = left;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    }<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>    /**<a name="line.80"></a>
+<span class="sourceLineNo">081</span>     * &lt;p&gt;<a name="line.81"></a>
+<span class="sourceLineNo">082</span>     * This compares "left" field against the "right" parameter<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     * using the "edit distance" implementation.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     * &lt;/p&gt;<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     *<a name="line.85"></a>
+<span class="sourceLineNo">086</span>     * @param right the second CharSequence<a name="line.86"></a>
+<span class="sourceLineNo">087</span>     * @return the similarity score between two CharSequences<a name="line.87"></a>
+<span class="sourceLineNo">088</span>     */<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    public R apply(CharSequence right) {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>        return editDistance.apply(left, right);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    }<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>    /**<a name="line.93"></a>
+<span class="sourceLineNo">094</span>     * Gets the left parameter.<a name="line.94"></a>
+<span class="sourceLineNo">095</span>     *<a name="line.95"></a>
+<span class="sourceLineNo">096</span>     * @return the left parameter<a name="line.96"></a>
+<span class="sourceLineNo">097</span>     */<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    public CharSequence getLeft() {<a name="line.98"></a>
+<span class="sourceLineNo">099</span>        return left;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    }<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>    /**<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     * Gets the edit distance.<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     *<a name="line.104"></a>
+<span class="sourceLineNo">105</span>     * @return the edit distance<a name="line.105"></a>
+<span class="sourceLineNo">106</span>     */<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    public EditDistance&lt;R&gt; getEditDistance() {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>        return editDistance;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    }<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>}<a name="line.111"></a>
 
 
 
@@ -181,4 +180,4 @@
 </pre>
 </div>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/FuzzyScore.html
==============================================================================
--- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/FuzzyScore.html (original)
+++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/FuzzyScore.html Sun Apr 26 10:18:25 2015
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+<html lang="de">
 <head>
 <title>Source code</title>
 <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
@@ -38,118 +38,116 @@
 <span class="sourceLineNo">030</span> * &lt;p&gt;<a name="line.30"></a>
 <span class="sourceLineNo">031</span> * This code has been adapted from Apache Commons Lang 3.3.<a name="line.31"></a>
 <span class="sourceLineNo">032</span> * &lt;/p&gt;<a name="line.32"></a>
-<span class="sourceLineNo">033</span> *<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * @since 1.0<a name="line.34"></a>
-<span class="sourceLineNo">035</span> */<a name="line.35"></a>
-<span class="sourceLineNo">036</span>public class FuzzyScore {<a name="line.36"></a>
-<span class="sourceLineNo">037</span><a name="line.37"></a>
-<span class="sourceLineNo">038</span>    /**<a name="line.38"></a>
-<span class="sourceLineNo">039</span>     * Locale used to change the case of text.<a name="line.39"></a>
-<span class="sourceLineNo">040</span>     */<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    private final Locale locale;<a name="line.41"></a>
-<span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>    /**<a name="line.44"></a>
-<span class="sourceLineNo">045</span>     * &lt;p&gt;This returns a {@link Locale}-specific {@link FuzzyScore}.&lt;/p&gt;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>     *<a name="line.46"></a>
-<span class="sourceLineNo">047</span>     * @param locale The string matching logic is case insensitive.<a name="line.47"></a>
-<span class="sourceLineNo">048</span>                     A {@link Locale} is necessary to normalize both Strings to lower case.<a name="line.48"></a>
-<span class="sourceLineNo">049</span>     * @throws IllegalArgumentException<a name="line.49"></a>
-<span class="sourceLineNo">050</span>     *         This is thrown if the {@link Locale} parameter is {@code null}.<a name="line.50"></a>
-<span class="sourceLineNo">051</span>     */<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    public FuzzyScore(final Locale locale) {<a name="line.52"></a>
-<span class="sourceLineNo">053</span>        if (locale == null) {<a name="line.53"></a>
-<span class="sourceLineNo">054</span>            throw new IllegalArgumentException("Locale must not be null");<a name="line.54"></a>
-<span class="sourceLineNo">055</span>        }<a name="line.55"></a>
-<span class="sourceLineNo">056</span>        this.locale = locale;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    }<a name="line.57"></a>
-<span class="sourceLineNo">058</span><a name="line.58"></a>
-<span class="sourceLineNo">059</span>    /**<a name="line.59"></a>
-<span class="sourceLineNo">060</span>     * &lt;p&gt;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>     * Find the Fuzzy Score which indicates the similarity score between two<a name="line.61"></a>
-<span class="sourceLineNo">062</span>     * Strings.<a name="line.62"></a>
-<span class="sourceLineNo">063</span>     * &lt;/p&gt;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>     *<a name="line.64"></a>
-<span class="sourceLineNo">065</span>     * &lt;pre&gt;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>     * score.fuzzyScore(null, null, null)                                    = IllegalArgumentException<a name="line.66"></a>
-<span class="sourceLineNo">067</span>     * score.fuzzyScore("", "", Locale.ENGLISH)                              = 0<a name="line.67"></a>
-<span class="sourceLineNo">068</span>     * score.fuzzyScore("Workshop", "b", Locale.ENGLISH)                     = 0<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * score.fuzzyScore("Room", "o", Locale.ENGLISH)                         = 1<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     * score.fuzzyScore("Workshop", "w", Locale.ENGLISH)                     = 1<a name="line.70"></a>
-<span class="sourceLineNo">071</span>     * score.fuzzyScore("Workshop", "ws", Locale.ENGLISH)                    = 2<a name="line.71"></a>
-<span class="sourceLineNo">072</span>     * score.fuzzyScore("Workshop", "wo", Locale.ENGLISH)                    = 4<a name="line.72"></a>
-<span class="sourceLineNo">073</span>     * score.fuzzyScore("Apache Software Foundation", "asf", Locale.ENGLISH) = 3<a name="line.73"></a>
-<span class="sourceLineNo">074</span>     * &lt;/pre&gt;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>     *<a name="line.75"></a>
-<span class="sourceLineNo">076</span>     * @param term a full term that should be matched against, must not be null<a name="line.76"></a>
-<span class="sourceLineNo">077</span>     * @param query the query that will be matched against a term, must not be<a name="line.77"></a>
-<span class="sourceLineNo">078</span>     *            null<a name="line.78"></a>
-<span class="sourceLineNo">079</span>     * @return result score<a name="line.79"></a>
-<span class="sourceLineNo">080</span>     * @throws IllegalArgumentException if either String input {@code null} or<a name="line.80"></a>
-<span class="sourceLineNo">081</span>     *             Locale input {@code null}<a name="line.81"></a>
-<span class="sourceLineNo">082</span>     */<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    public Integer fuzzyScore(CharSequence term, CharSequence query) {<a name="line.83"></a>
-<span class="sourceLineNo">084</span>        if (term == null || query == null) {<a name="line.84"></a>
-<span class="sourceLineNo">085</span>            throw new IllegalArgumentException("Strings must not be null");<a name="line.85"></a>
-<span class="sourceLineNo">086</span>        }<a name="line.86"></a>
-<span class="sourceLineNo">087</span><a name="line.87"></a>
-<span class="sourceLineNo">088</span>        // fuzzy logic is case insensitive. We normalize the Strings to lower<a name="line.88"></a>
-<span class="sourceLineNo">089</span>        // case right from the start. Turning characters to lower case<a name="line.89"></a>
-<span class="sourceLineNo">090</span>        // via Character.toLowerCase(char) is unfortunately insufficient<a name="line.90"></a>
-<span class="sourceLineNo">091</span>        // as it does not accept a locale.<a name="line.91"></a>
-<span class="sourceLineNo">092</span>        final String termLowerCase = term.toString().toLowerCase(locale);<a name="line.92"></a>
-<span class="sourceLineNo">093</span>        final String queryLowerCase = query.toString().toLowerCase(locale);<a name="line.93"></a>
-<span class="sourceLineNo">094</span><a name="line.94"></a>
-<span class="sourceLineNo">095</span>        // the resulting score<a name="line.95"></a>
-<span class="sourceLineNo">096</span>        int score = 0;<a name="line.96"></a>
-<span class="sourceLineNo">097</span><a name="line.97"></a>
-<span class="sourceLineNo">098</span>        // the position in the term which will be scanned next for potential<a name="line.98"></a>
-<span class="sourceLineNo">099</span>        // query character matches<a name="line.99"></a>
-<span class="sourceLineNo">100</span>        int termIndex = 0;<a name="line.100"></a>
-<span class="sourceLineNo">101</span><a name="line.101"></a>
-<span class="sourceLineNo">102</span>        // index of the previously matched character in the term<a name="line.102"></a>
-<span class="sourceLineNo">103</span>        int previousMatchingCharacterIndex = Integer.MIN_VALUE;<a name="line.103"></a>
-<span class="sourceLineNo">104</span><a name="line.104"></a>
-<span class="sourceLineNo">105</span>        for (int queryIndex = 0; queryIndex &lt; queryLowerCase.length(); queryIndex++) {<a name="line.105"></a>
-<span class="sourceLineNo">106</span>            final char queryChar = queryLowerCase.charAt(queryIndex);<a name="line.106"></a>
-<span class="sourceLineNo">107</span><a name="line.107"></a>
-<span class="sourceLineNo">108</span>            boolean termCharacterMatchFound = false;<a name="line.108"></a>
-<span class="sourceLineNo">109</span>            for (; termIndex &lt; termLowerCase.length()<a name="line.109"></a>
-<span class="sourceLineNo">110</span>                    &amp;&amp; !termCharacterMatchFound; termIndex++) {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>                final char termChar = termLowerCase.charAt(termIndex);<a name="line.111"></a>
-<span class="sourceLineNo">112</span><a name="line.112"></a>
-<span class="sourceLineNo">113</span>                if (queryChar == termChar) {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>                    // simple character matches result in one point<a name="line.114"></a>
-<span class="sourceLineNo">115</span>                    score++;<a name="line.115"></a>
-<span class="sourceLineNo">116</span><a name="line.116"></a>
-<span class="sourceLineNo">117</span>                    // subsequent character matches further improve<a name="line.117"></a>
-<span class="sourceLineNo">118</span>                    // the score.<a name="line.118"></a>
-<span class="sourceLineNo">119</span>                    if (previousMatchingCharacterIndex + 1 == termIndex) {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>                        score += 2;<a name="line.120"></a>
-<span class="sourceLineNo">121</span>                    }<a name="line.121"></a>
+<span class="sourceLineNo">033</span> */<a name="line.33"></a>
+<span class="sourceLineNo">034</span>public class FuzzyScore {<a name="line.34"></a>
+<span class="sourceLineNo">035</span><a name="line.35"></a>
+<span class="sourceLineNo">036</span>    /**<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     * Locale used to change the case of text.<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     */<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    private final Locale locale;<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span>    /**<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     * &lt;p&gt;This returns a {@link Locale}-specific {@link FuzzyScore}.&lt;/p&gt;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>     *<a name="line.44"></a>
+<span class="sourceLineNo">045</span>     * @param locale The string matching logic is case insensitive.<a name="line.45"></a>
+<span class="sourceLineNo">046</span>                     A {@link Locale} is necessary to normalize both Strings to lower case.<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     * @throws IllegalArgumentException<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     *         This is thrown if the {@link Locale} parameter is {@code null}.<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     */<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    public FuzzyScore(final Locale locale) {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        if (locale == null) {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>            throw new IllegalArgumentException("Locale must not be null");<a name="line.52"></a>
+<span class="sourceLineNo">053</span>        }<a name="line.53"></a>
+<span class="sourceLineNo">054</span>        this.locale = locale;<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    }<a name="line.55"></a>
+<span class="sourceLineNo">056</span><a name="line.56"></a>
+<span class="sourceLineNo">057</span>    /**<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     * &lt;p&gt;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * Find the Fuzzy Score which indicates the similarity score between two<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     * Strings.<a name="line.60"></a>
+<span class="sourceLineNo">061</span>     * &lt;/p&gt;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     *<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     * &lt;pre&gt;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>     * score.fuzzyScore(null, null, null)                                    = IllegalArgumentException<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     * score.fuzzyScore("", "", Locale.ENGLISH)                              = 0<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     * score.fuzzyScore("Workshop", "b", Locale.ENGLISH)                     = 0<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * score.fuzzyScore("Room", "o", Locale.ENGLISH)                         = 1<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     * score.fuzzyScore("Workshop", "w", Locale.ENGLISH)                     = 1<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * score.fuzzyScore("Workshop", "ws", Locale.ENGLISH)                    = 2<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * score.fuzzyScore("Workshop", "wo", Locale.ENGLISH)                    = 4<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     * score.fuzzyScore("Apache Software Foundation", "asf", Locale.ENGLISH) = 3<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     * &lt;/pre&gt;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     *<a name="line.73"></a>
+<span class="sourceLineNo">074</span>     * @param term a full term that should be matched against, must not be null<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     * @param query the query that will be matched against a term, must not be<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     *            null<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     * @return result score<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     * @throws IllegalArgumentException if either String input {@code null} or<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     *             Locale input {@code null}<a name="line.79"></a>
+<span class="sourceLineNo">080</span>     */<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    public Integer fuzzyScore(CharSequence term, CharSequence query) {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>        if (term == null || query == null) {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>            throw new IllegalArgumentException("Strings must not be null");<a name="line.83"></a>
+<span class="sourceLineNo">084</span>        }<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>        // fuzzy logic is case insensitive. We normalize the Strings to lower<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        // case right from the start. Turning characters to lower case<a name="line.87"></a>
+<span class="sourceLineNo">088</span>        // via Character.toLowerCase(char) is unfortunately insufficient<a name="line.88"></a>
+<span class="sourceLineNo">089</span>        // as it does not accept a locale.<a name="line.89"></a>
+<span class="sourceLineNo">090</span>        final String termLowerCase = term.toString().toLowerCase(locale);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>        final String queryLowerCase = query.toString().toLowerCase(locale);<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>        // the resulting score<a name="line.93"></a>
+<span class="sourceLineNo">094</span>        int score = 0;<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>        // the position in the term which will be scanned next for potential<a name="line.96"></a>
+<span class="sourceLineNo">097</span>        // query character matches<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        int termIndex = 0;<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>        // index of the previously matched character in the term<a name="line.100"></a>
+<span class="sourceLineNo">101</span>        int previousMatchingCharacterIndex = Integer.MIN_VALUE;<a name="line.101"></a>
+<span class="sourceLineNo">102</span><a name="line.102"></a>
+<span class="sourceLineNo">103</span>        for (int queryIndex = 0; queryIndex &lt; queryLowerCase.length(); queryIndex++) {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>            final char queryChar = queryLowerCase.charAt(queryIndex);<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>            boolean termCharacterMatchFound = false;<a name="line.106"></a>
+<span class="sourceLineNo">107</span>            for (; termIndex &lt; termLowerCase.length()<a name="line.107"></a>
+<span class="sourceLineNo">108</span>                    &amp;&amp; !termCharacterMatchFound; termIndex++) {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>                final char termChar = termLowerCase.charAt(termIndex);<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>                if (queryChar == termChar) {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>                    // simple character matches result in one point<a name="line.112"></a>
+<span class="sourceLineNo">113</span>                    score++;<a name="line.113"></a>
+<span class="sourceLineNo">114</span><a name="line.114"></a>
+<span class="sourceLineNo">115</span>                    // subsequent character matches further improve<a name="line.115"></a>
+<span class="sourceLineNo">116</span>                    // the score.<a name="line.116"></a>
+<span class="sourceLineNo">117</span>                    if (previousMatchingCharacterIndex + 1 == termIndex) {<a name="line.117"></a>
+<span class="sourceLineNo">118</span>                        score += 2;<a name="line.118"></a>
+<span class="sourceLineNo">119</span>                    }<a name="line.119"></a>
+<span class="sourceLineNo">120</span><a name="line.120"></a>
+<span class="sourceLineNo">121</span>                    previousMatchingCharacterIndex = termIndex;<a name="line.121"></a>
 <span class="sourceLineNo">122</span><a name="line.122"></a>
-<span class="sourceLineNo">123</span>                    previousMatchingCharacterIndex = termIndex;<a name="line.123"></a>
-<span class="sourceLineNo">124</span><a name="line.124"></a>
-<span class="sourceLineNo">125</span>                    // we can leave the nested loop. Every character in the<a name="line.125"></a>
-<span class="sourceLineNo">126</span>                    // query can match at most one character in the term.<a name="line.126"></a>
-<span class="sourceLineNo">127</span>                    termCharacterMatchFound = true;<a name="line.127"></a>
-<span class="sourceLineNo">128</span>                }<a name="line.128"></a>
-<span class="sourceLineNo">129</span>            }<a name="line.129"></a>
-<span class="sourceLineNo">130</span>        }<a name="line.130"></a>
-<span class="sourceLineNo">131</span><a name="line.131"></a>
-<span class="sourceLineNo">132</span>        return score;<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    }<a name="line.133"></a>
-<span class="sourceLineNo">134</span><a name="line.134"></a>
-<span class="sourceLineNo">135</span>    /**<a name="line.135"></a>
-<span class="sourceLineNo">136</span>     * Gets the locale.<a name="line.136"></a>
-<span class="sourceLineNo">137</span>     *<a name="line.137"></a>
-<span class="sourceLineNo">138</span>     * @return the locale<a name="line.138"></a>
-<span class="sourceLineNo">139</span>     */<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    public Locale getLocale() {<a name="line.140"></a>
-<span class="sourceLineNo">141</span>        return locale;<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    }<a name="line.142"></a>
-<span class="sourceLineNo">143</span><a name="line.143"></a>
-<span class="sourceLineNo">144</span>}<a name="line.144"></a>
+<span class="sourceLineNo">123</span>                    // we can leave the nested loop. Every character in the<a name="line.123"></a>
+<span class="sourceLineNo">124</span>                    // query can match at most one character in the term.<a name="line.124"></a>
+<span class="sourceLineNo">125</span>                    termCharacterMatchFound = true;<a name="line.125"></a>
+<span class="sourceLineNo">126</span>                }<a name="line.126"></a>
+<span class="sourceLineNo">127</span>            }<a name="line.127"></a>
+<span class="sourceLineNo">128</span>        }<a name="line.128"></a>
+<span class="sourceLineNo">129</span><a name="line.129"></a>
+<span class="sourceLineNo">130</span>        return score;<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    }<a name="line.131"></a>
+<span class="sourceLineNo">132</span><a name="line.132"></a>
+<span class="sourceLineNo">133</span>    /**<a name="line.133"></a>
+<span class="sourceLineNo">134</span>     * Gets the locale.<a name="line.134"></a>
+<span class="sourceLineNo">135</span>     *<a name="line.135"></a>
+<span class="sourceLineNo">136</span>     * @return the locale<a name="line.136"></a>
+<span class="sourceLineNo">137</span>     */<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    public Locale getLocale() {<a name="line.138"></a>
+<span class="sourceLineNo">139</span>        return locale;<a name="line.139"></a>
+<span class="sourceLineNo">140</span>    }<a name="line.140"></a>
+<span class="sourceLineNo">141</span><a name="line.141"></a>
+<span class="sourceLineNo">142</span>}<a name="line.142"></a>
 
 
 
@@ -213,4 +211,4 @@
 </pre>
 </div>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/HammingDistance.html
==============================================================================
--- websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/HammingDistance.html (original)
+++ websites/production/commons/content/sandbox/commons-text/apidocs/src-html/org/apache/commons/text/similarity/HammingDistance.html Sun Apr 26 10:18:25 2015
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+<html lang="de">
 <head>
 <title>Source code</title>
 <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
@@ -32,58 +32,56 @@
 <span class="sourceLineNo">024</span> * For further explanation about the Hamming Distance, take a look at its<a name="line.24"></a>
 <span class="sourceLineNo">025</span> * Wikipedia page at http://en.wikipedia.org/wiki/Hamming_distance.<a name="line.25"></a>
 <span class="sourceLineNo">026</span> * &lt;/p&gt;<a name="line.26"></a>
-<span class="sourceLineNo">027</span> *<a name="line.27"></a>
-<span class="sourceLineNo">028</span> * @since 1.0<a name="line.28"></a>
-<span class="sourceLineNo">029</span> */<a name="line.29"></a>
-<span class="sourceLineNo">030</span>public class HammingDistance implements EditDistance&lt;Integer&gt; {<a name="line.30"></a>
-<span class="sourceLineNo">031</span><a name="line.31"></a>
-<span class="sourceLineNo">032</span>    /**<a name="line.32"></a>
-<span class="sourceLineNo">033</span>     * Find the Hamming Distance between two strings with the same<a name="line.33"></a>
-<span class="sourceLineNo">034</span>     * length.<a name="line.34"></a>
-<span class="sourceLineNo">035</span>     *<a name="line.35"></a>
-<span class="sourceLineNo">036</span>     * &lt;p&gt;The distance starts with zero, and for each occurrence of a<a name="line.36"></a>
-<span class="sourceLineNo">037</span>     * different character in either String, it increments the distance<a name="line.37"></a>
-<span class="sourceLineNo">038</span>     * by 1, and finally return its value.&lt;/p&gt;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>     *<a name="line.39"></a>
-<span class="sourceLineNo">040</span>     * &lt;p&gt;Since the Hamming Distance can only be calculated between strings of equal length, input of different lengths<a name="line.40"></a>
-<span class="sourceLineNo">041</span>     * will throw IllegalArgumentException&lt;/p&gt;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>     *<a name="line.42"></a>
-<span class="sourceLineNo">043</span>     * &lt;pre&gt;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>     * distance.apply("", "")               = 0<a name="line.44"></a>
-<span class="sourceLineNo">045</span>     * distance.apply("pappa", "pappa")     = 0<a name="line.45"></a>
-<span class="sourceLineNo">046</span>     * distance.apply("1011101", "1011111") = 1<a name="line.46"></a>
-<span class="sourceLineNo">047</span>     * distance.apply("ATCG", "ACCC")       = 2<a name="line.47"></a>
-<span class="sourceLineNo">048</span>     * distance.apply("karolin", "kerstin"  = 3<a name="line.48"></a>
-<span class="sourceLineNo">049</span>     * &lt;/pre&gt;<a name="line.49"></a>
-<span class="sourceLineNo">050</span>     *<a name="line.50"></a>
-<span class="sourceLineNo">051</span>     * @param left the first CharSequence, must not be null<a name="line.51"></a>
-<span class="sourceLineNo">052</span>     * @param right the second CharSequence, must not be null<a name="line.52"></a>
-<span class="sourceLineNo">053</span>     * @return distance<a name="line.53"></a>
-<span class="sourceLineNo">054</span>     * @throws IllegalArgumentException if either input is {@code null} or<a name="line.54"></a>
-<span class="sourceLineNo">055</span>     *             if they do not have the same length<a name="line.55"></a>
-<span class="sourceLineNo">056</span>     */<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    @Override<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    public Integer apply(CharSequence left, CharSequence right) {<a name="line.58"></a>
-<span class="sourceLineNo">059</span>        if (left == null || right == null) {<a name="line.59"></a>
-<span class="sourceLineNo">060</span>            throw new IllegalArgumentException("Strings must not be null");<a name="line.60"></a>
-<span class="sourceLineNo">061</span>        }<a name="line.61"></a>
-<span class="sourceLineNo">062</span><a name="line.62"></a>
-<span class="sourceLineNo">063</span>        if (left.length() != right.length()) {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>            throw new IllegalArgumentException("Strings must have the same length");<a name="line.64"></a>
-<span class="sourceLineNo">065</span>        }<a name="line.65"></a>
+<span class="sourceLineNo">027</span> */<a name="line.27"></a>
+<span class="sourceLineNo">028</span>public class HammingDistance implements EditDistance&lt;Integer&gt; {<a name="line.28"></a>
+<span class="sourceLineNo">029</span><a name="line.29"></a>
+<span class="sourceLineNo">030</span>    /**<a name="line.30"></a>
+<span class="sourceLineNo">031</span>     * Find the Hamming Distance between two strings with the same<a name="line.31"></a>
+<span class="sourceLineNo">032</span>     * length.<a name="line.32"></a>
+<span class="sourceLineNo">033</span>     *<a name="line.33"></a>
+<span class="sourceLineNo">034</span>     * &lt;p&gt;The distance starts with zero, and for each occurrence of a<a name="line.34"></a>
+<span class="sourceLineNo">035</span>     * different character in either String, it increments the distance<a name="line.35"></a>
+<span class="sourceLineNo">036</span>     * by 1, and finally return its value.&lt;/p&gt;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     *<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     * &lt;p&gt;Since the Hamming Distance can only be calculated between strings of equal length, input of different lengths<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     * will throw IllegalArgumentException&lt;/p&gt;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>     *<a name="line.40"></a>
+<span class="sourceLineNo">041</span>     * &lt;pre&gt;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>     * distance.apply("", "")               = 0<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     * distance.apply("pappa", "pappa")     = 0<a name="line.43"></a>
+<span class="sourceLineNo">044</span>     * distance.apply("1011101", "1011111") = 1<a name="line.44"></a>
+<span class="sourceLineNo">045</span>     * distance.apply("ATCG", "ACCC")       = 2<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * distance.apply("karolin", "kerstin"  = 3<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     * &lt;/pre&gt;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     *<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     * @param left the first CharSequence, must not be null<a name="line.49"></a>
+<span class="sourceLineNo">050</span>     * @param right the second CharSequence, must not be null<a name="line.50"></a>
+<span class="sourceLineNo">051</span>     * @return distance<a name="line.51"></a>
+<span class="sourceLineNo">052</span>     * @throws IllegalArgumentException if either input is {@code null} or<a name="line.52"></a>
+<span class="sourceLineNo">053</span>     *             if they do not have the same length<a name="line.53"></a>
+<span class="sourceLineNo">054</span>     */<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    @Override<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    public Integer apply(CharSequence left, CharSequence right) {<a name="line.56"></a>
+<span class="sourceLineNo">057</span>        if (left == null || right == null) {<a name="line.57"></a>
+<span class="sourceLineNo">058</span>            throw new IllegalArgumentException("Strings must not be null");<a name="line.58"></a>
+<span class="sourceLineNo">059</span>        }<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span>        if (left.length() != right.length()) {<a name="line.61"></a>
+<span class="sourceLineNo">062</span>            throw new IllegalArgumentException("Strings must have the same length");<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        }<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>        int distance = 0;<a name="line.65"></a>
 <span class="sourceLineNo">066</span><a name="line.66"></a>
-<span class="sourceLineNo">067</span>        int distance = 0;<a name="line.67"></a>
-<span class="sourceLineNo">068</span><a name="line.68"></a>
-<span class="sourceLineNo">069</span>        for (int i = 0; i &lt; left.length(); i++) {<a name="line.69"></a>
-<span class="sourceLineNo">070</span>            if (left.charAt(i) != right.charAt(i)) {<a name="line.70"></a>
-<span class="sourceLineNo">071</span>                distance++;<a name="line.71"></a>
-<span class="sourceLineNo">072</span>            }<a name="line.72"></a>
-<span class="sourceLineNo">073</span>        }<a name="line.73"></a>
-<span class="sourceLineNo">074</span><a name="line.74"></a>
-<span class="sourceLineNo">075</span>        return distance;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    }<a name="line.76"></a>
-<span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>}<a name="line.78"></a>
+<span class="sourceLineNo">067</span>        for (int i = 0; i &lt; left.length(); i++) {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>            if (left.charAt(i) != right.charAt(i)) {<a name="line.68"></a>
+<span class="sourceLineNo">069</span>                distance++;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>            }<a name="line.70"></a>
+<span class="sourceLineNo">071</span>        }<a name="line.71"></a>
+<span class="sourceLineNo">072</span><a name="line.72"></a>
+<span class="sourceLineNo">073</span>        return distance;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    }<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>}<a name="line.76"></a>
 
 
 
@@ -147,4 +145,4 @@
 </pre>
 </div>
 </body>
-</html>
+</html>
\ No newline at end of file



Mime
View raw message