public double score ( StringWrapper s , StringWrapper t ) { String S = s . unwrap ( ) , T = t . unwrap ( ) ; totalScore = 0.0 ; if ( S . equals ( T ) ) { matched = S . length ( ) ; return 1.0 ; } else { sSize = S . length ( ) ; tSize = T . length ( ) ; // let S be the largest token if ( sSize < tSize ) { String tmp1 = S ; S = T ; T = tmp1 ; double tmp2 = sSize ; sSize = tSize ; tSize = tmp2 ; tokenT = T ; } tokenT = S ; ArrayList candidateList = algorithm1 ( S , T ) ; sortList ( candidateList ) ; totalScore = getScore ( candidateList ) ; totalScore = ( totalScore / ( ( double ) sSize ) + totalScore / ( ( double ) tSize ) ) / 2.0 ; return winkler ( totalScore , S , T ) ; } }
score return the a strng distance value between 0 and 1 of a pair of tokens . Where 1 is the maximum similarity .