package com.aif.language.semantic.weights.word;

import com.aif.language.semantic.ISemanticNode;
import com.aif.language.semantic.weights.IWeightCalculator;
import com.aif.language.word.Word;

public class TokensCountBasedWeightCalculator implements IWeightCalculator<Word>{

    @Override
    public double calculateWeight(ISemanticNode<Word> semanticNode) {
        final Word word = semanticNode.getNode();
        return 1.0 - 1.0 / (double)word.getTokens();
    }

}

@@ -396,15 +396,12 @@
 ode.
-getNode
+item
 ();%0A
@@ -451,16 +451,23 @@
 Tokens()
+.size()
 ;%0A    %7D%0A

Fix of tests