示例#1
0
def translate3(text):
    result = ""
    for c in text:
        if not is_vowel(c) and c.isalpha():
            result += "".join([c, "o", c])
        else:
            result += c
    return result
示例#2
0
def translate1(text):
    result = ""
    for c in text:
        if is_vowel(c):
            result += c
        else:
            result += "".join([c, "o", c])
    return result
示例#3
0
def make_ing_form(verb):
    if len(verb) >= 3:
        if (is_consonant(verb[-3:-2])
            and is_vowel(verb[-2:-1])
            and is_consonant(verb[-1:])):
            return verb + verb[-1:] + "ing"
    if verb[-2:] == "ie":
        return verb[:-2] + "ying"
    if verb[-1:] == "e":
        return verb[:-1] + "ing"