def relFreqProfile(freqprof):
   """Generates a relative frequency profile from an absolute frequency
      profile."""
   tokenCount = sum(freqprof.values())
   if tokenCount > 0:
      return dict(((i[0], i[1]/tokenCount) for i in freqprof.items()))