def sumFrequenciesToProb(freqPairsList, freqSingleList, freqSumList):
    """
    Sums all frequencies in provided lists, and transforms them to probabilities according
    to the sum of frequencies found in 'freqSumList'.
    """
    fSum = sum(freqSumList)
    probPairs, probSingle = {}, {}
    for freqPairs, freqSingle in zip(freqPairsList, freqSingleList):
        for key, value in freqPairs.items():
            try:
                probPairs[key] += value / fSum
            except:
                probPairs[key] = value / fSum
        for key, value in freqSingle.items():
            try:
                probSingle[key] += value / fSum
            except:
                probSingle[key] = value / fSum
    return probPairs, probSingle
