def score(item, fd, key):
    """Assign a score to an item based based on a frequency distribution
    
    item: something counted in a frequency distribution based on a key
    fd:   a frequency distribution (an instance of collections.Counter)
    key:  a method that returns a key value in the frequency distribution
          a key method must return a hashable value
    
    """
    return fd.get(key(item), 0)