def step_4(w):
    for suffix, rules in suffixes4:
        if w.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")):
        # Delete -ion if preceded by s or t.
        return w[:-3]
    return w
For each item-item pair, return the specified similarity measure,
dataset/ETHPy150Open clips/pattern/pattern/vector/stemmer.py/step_4--crossover with--dataset/ETHPy150Open evancasey/spark-knn-recommender/algorithms/itemSimilarity.py/calcSim