create a function to get frequency distribution of given string

def countWords(data):
    # tokens = nltk.tokenize.word_tokenize(data)
    tokens = preprocess(data)
    fdist = FreqDist(tokens) #input is a list of string
    return fdist