protected Double computeAssociation ( SemanticSpace sspace , String word1 , String word2 ) { Vector v1 = sspace . getVector ( word1 ) ; Vector v2 = sspace . getVector ( word2 ) ; if ( v1 == null || v2 == null ) return null ; // Find the ranks of each of the two words to each other double rank1 = findRank ( sspace , word1 , word2 ) ; double rank2 = findRank ( sspace , word2 , word1 ) ; return 2d / ( rank1 + rank2 ) ; }
Returns the association of the two words on a scale of 0 to 1 .