The rule applies only to the following words: "seven," "thirty," "fifty," "seventy," and "ninety." The function returns "undefined" for other inputs.