def matchSetContribution(match_set, target_set, index):
 contribution = 0.0
 for t in target_set:
  match = (- float('inf'))
  id = (-1)
  for (i, m) in enumerate(match_set):
   v = matchStrength(m, t)
   if (v > match):
    match = v
    id = i
  if (id == index):
   contribution += match
 return ((contribution / len(target_set)),)

def matchSetContribution ( match_set , target_set , index ) : contribution = 0.0 for t in target_set : match = ( - float ( 'inf' ) ) id = ( - 1 ) for ( i , m ) in enumerate ( match_set ) : v = matchStrength ( m , t ) if ( v > match ) : match = v id = i if ( id == index ) : contribution += match return ( ( contribution / len ( target_set ) ) , )
compute the contribution of the string at *index* in the match set .