calculate_word_distribution function

Calculate word distribution across text segments or sections