def word_nucleus(word):
    """
    Find the nucleus for a word in Pinyin.

    The basic rule for finding the nucleus of a word in Pinyin is that if
    the word contains A / E / OU, then we know the answer automatically.
    If none of those are present, then just find the last vowel. This
    function returns the nucleus character.

    """
    if 'a' in word:
        return 'a'
    elif 'A' in word:
        return 'A'
    elif 'e' in word:
        return 'e'
    elif 'E' in word:
        return 'E'
    elif 'ou' in word or 'oU' in word:
        return 'o'
    elif 'OU' in word or 'Ou' in word:
        return 'O'
    for i in range(len(word) - 1, -1, -1):
        if word[i] in 'aeiouüvAEIOUÜV':
            return word[i]
    return None
