Docstring for generate word
Calculate total probabilities of words