Company: ZS_14oct
Difficulty: medium
Problem Description You are tasked with implementing a basic stemming algorithm to extract the base form of words. Write a Python function stemmer(text: str) -> str that takes a string of space-separated words and returns its stemmed counterpart by applying the following rules to each word in order: Suffix Removal: If the word ends in "ed" , "ly" , or "ing" , remove that suffix. Truncation: If the resulting word from step 1 is longer than 8 letters, keep only the first 8 letters. Input A single string text passed as a function argument, representing the input text of space-separated words. Output Returns a single string containing the input text with each word replaced by its stemmed counterpart, separated by single spaces. Constraints Every character in text is either an English lowercase letter ( a-z ) or a space character. text starts and ends with a letter. No two consecutive characters in the input are spaces. text contains at most 100 words. No single word in text is longer th