@@ -0,0 +1,727 @@
+package edu.antonym.test;%0A%0Apublic class CosineSimilarity %7B%0A%09%0A%09public double cosineSimilarity(float%5B%5D vector1, float%5B%5D vector2) %7B%0A%09%09double dotProduct = 0.0;%0A%09%09double v1 = 0.0;%0A%09%09double v2 = 0.0;%0A%09%09double cosineSimilarity = 0.0;%0A%0A        for (int i = 0; i %3C vector1.length; i++) //vector1 and vector2 must be of same length%0A        %7B%0A            dotProduct += vector1%5Bi%5D * vector2%5Bi%5D;  %0A            v1 += Math.pow(vector1%5Bi%5D, 2);  %0A            v2 += Math.pow(vector2%5Bi%5D, 2); %0A        %7D%0A%0A        v1 = Math.sqrt(v1);%09%0A        v2 = Math.sqrt(v2);%09%0A%0A        if (v1 != 0.0 && v2 != 0.0) %7B%0A            cosineSimilarity = dotProduct / (v1 * v2);%0A        %7D else %7B%0A            return 0;%0A        %7D%0A        return cosineSimilarity;%0A    %7D%0A%7D%0A

Create CosineSimilarity.java