'Returns the base form of the given inflected verb, using a rule-based approach.
This is problematic if a verb ending in -e is given in the past tense or gerund.'

def find_lemma(self, verb):

    v = verb.lower()
    for prefix in ('aan', 'be', 'her', 'in', 'mee', 'ont', 'op', 'over', 'uit', 'ver'):
        if (v.startswith(prefix) and (v[len(prefix):] in self.inflections)):
            return (prefix + self.inflections[v[len(prefix):]])
    if v.endswith('end'):
        b = v[:(-3)]
    elif v.endswith(('de', 'det', 'te', 'tet')):
        b = v[:(-2)]
    elif v.endswith('chten'):
        b = v[:(-2)]
    elif (v.endswith(('den', 'ten')) and (len(v) > 3) and is_vowel(v[(-4)])):
        b = v[:(-2)]
    elif v.endswith(('den', 'ten')):
        b = v[:(-3)]
    elif (v.endswith(('d', 't')) and v.startswith('ge')):
        b = v[2:(-1)]
    elif v.endswith('cht'):
        b = v
    elif v.endswith(('dt', 'bt', 'gt', 'kt', 'mt', 'pt', 'wt', 'xt', 'aait', 'ooit')):
        b = v[:(-1)]
    elif (v.endswith('t') and (len(v) > 2) and (not is_vowel(v[(-2)]))):
        b = v[:(-1)]
    elif (v.endswith('en') and (len(v) > 3)):
        return v
    else:
        b = v
    if ((len(b) > 2) and b.endswith(('el', 'nder', 'om', 'tter')) and (not is_vowel(b[(-3)]))):
        pass
    elif (((len(b) > 2) and (not is_vowel(b[(-1)])) and is_vowel(b[(-2)]) and is_vowel(b[(-3)])) or b.endswith(('ijf', 'erf'))):
        if b.endswith('f'):
            b = (b[:(-1)] + 'v')
        if b.endswith('s'):
            b = (b[:(-1)] + 'z')
        if (b[(-2)] == b[(-3)]):
            b = (b[:(-2)] + b[(-1)])
    elif ((len(b) > 1) and (not is_vowel(b[(-1)])) and is_vowel(b[(-2)]) and (not b.endswith(('er', 'ig')))):
        b = (b + b[(-1)])
    b = (b + 'en')
    b = b.replace('vven', 'ven')
    b = b.replace('zzen', 'zen')
    b = b.replace('aen', 'aan')
    return b
