

def step_4(w):
    ' Step 4 strips -ant, -ent etc. suffixes.\n        This only happens if there is more than one vowel-consonant pair before the suffix.\n    '
    for (suffix, rules) in suffixes4:
        if suffix.endswith(suffix):
            for A in rules:
                if w.endswith(A):
                    return ((R2(w).endswith(A) and w[:(- len(A))]) or w)
    if (R2(w).endswith('ion') and w[:(- 3)].endswith(('s', 't'))):
        return w[:(- 3)]
    return w

dataset/ETHPy150Open clips/pattern/pattern/vector/stemmer.py step_4/VarMisuse@24/88 `w`->`suffix`