Text: "the the the big fish big in the pond pond"
构建一个函数来识别给定文本中最常出现的单词。
def most_repeated_word(text):
    # 将文本拆分为单词列表
    words = text.split() 

    # 创建一个空字典 
    counts = {}

    # 迭代单词列表
    for word in words:
        # 计算每个单词的出现次数
        counts[word] = counts.get(word, 0) + 1
    
    # 将最大计数设置为0
    max_count = 0

    # 将最常出现的单词设置为空
    most_repeated_word = None

    # 迭代字典
    for k, v in counts.items():
        # 如果单词的计数最大，则将其存储
        if v > max_count:
            max_count = v
            most_repeated_word = k

    # 返回最常出现的单词
    return most_repeated_word

most_repeated_word("the the the big fish big in the pond pond")  # 返回 "the"