Skip to content
DeepForgeby svx
All problems
MediumNLPnlp-396

Porter Step One B Ed Ing Stripping

Problem

Porter step 1b removes a trailing "ed" or "ing" only when the remaining stem contains a vowel; a trailing "eed" becomes "ee" when the stem before it is nonempty and contains a vowel.

Given a word, return the result of one pass of these rules.

Hint

The removed suffix leaves a stem; only vowel-bearing stems trigger removal.

Test cases

case 1
in: ["agreed"]
expected: "agree"
case 2
in: ["plastered"]
expected: "plaster"
case 3
in: ["sing"]
expected: "sing"
Starter codePython
def porter_step_one_b_ed_ing_stripping(word):
    # Your code here
    pass

3 test cases · run your code against them in the editor