private static String step5(String word)
    {
        // step 5a
        if (word.endsWith("e") && getMeasure(stemWord(word, "e")) > 1) // (m>1) E -->
        {
            word = replace(word, "e", "");
        }
        else if (word.endsWith("e") && !endsWith_cvc(stemWord(word, "e")) &&
                 getMeasure(stemWord(word, "e")) == 1) // (m=1 and not *o) E -->
        {
            word = replace(word, "e", "");
        }
        // steb 5b
        else if (word.endsWith("l") && hasDoubleConsonantEnding(word) &&
                 getMeasure(word) > 1) // (m>1 and *d and *L) --> single letter
        {
            word = word.substring(0, word.length() - 1);
        }

        LOG.debug("After step 5: {}", word);
        return word;
    }