def get_mood_score(mood, year, filtered_db):
    """
    Calculates the mood score of the give mood for a given year
    :param mood, year, filtered_db:
    :return moodscore
    """
    moodcount = 0
    the_count = 0
    for item in filtered_db[year]:
        data = item.split('\t')
        if data[0] in mood or data[0].lower() in mood:
            moodcount += int(data[2])
        if data[0] == "the" or data[0].lower() == "the":
            the_count += int(data[2])
    moodscore = (1.0 * moodcount/the_count)/1.0*len(mood)
    return moodscore