@@ -0,0 +1,1497 @@
+import java.lang.Math;%0Aimport java.util.Set;%0Aimport java.util.HashSet;%0A%0Aimport irproject.IRProjectHelper;%0Aimport it.acubelab.tagme.RelatednessMeasure;%0A%0Apublic class MilneWittenLogistic extends RelatednessMeasure %7B%0A%0A    public MilneWittenLogistic (String lang) %7B%0A        super(lang);%0A    %7D%0A%0A    @Override%0A    public float rel (int first, int second) %7B%0A        int%5B%5D inFirst = IRProjectHelper.getInlinks(first);%0A        int%5B%5D inSecond = IRProjectHelper.getInlinks(second);%0A        int wikipediaSize = IRProjectHelper.getWikipediaSize();%0A%0A        Set%3CInteger%3E intersection = getIntersection(inFirst, inSecond);%0A        int intersectionSize = intersection.size() == 0 ? 1 : intersection.size();%0A%0A        float numerator = (float) Math.log(Math.max(inFirst.length, inSecond.length) - (float) Math.log(intersectionSize));%0A        float denominator = (float) Math.log(wikipediaSize) - (float) Math.log(Math.min(inFirst.length, inSecond.length));%0A        float result = numerator / denominator;%0A%0A        return ((float) 2 / ((float) 1 + Math.exp(result)) - 1);%0A    %7D%0A%0A    private Set%3CInteger%3E toSet (int%5B%5D arr) %7B%0A        Set%3CInteger%3E result = new HashSet%3CInteger%3E();%0A%0A        for (int i = 0; i %3C arr.length; i++) %7B%0A            result.add(arr%5Bi%5D);%0A        %7D%0A%0A        return result;%0A    %7D%0A%0A    private Set%3CInteger%3E getIntersection (int%5B%5D A, int%5B%5D B) %7B%0A        Set%3CInteger%3E result = toSet(A);%0A        Set%3CInteger%3E difference = toSet(B);%0A        result.retainAll(difference);%0A%0A        return result;%0A    %7D%0A%0A%7D%0A

Add MilneWittenLogistic.