Question: Regular expressions Problem 1. English Plurals Coding [10 points] While the English plural marker is written with an 's', in many cases it is actually
Regular expressions Problem 1. English Plurals Coding [10 points] While the English plural marker is written with an 's', in many cases it is actually pronounced as a 'z'. This happens when the final sound of the singular noun is voiced (produced with vibration of the vocal cords), because /2/ is the voiced counterpart of the voiceless /s/. The following table shows the other pairs of English consonants that are distinguished by voicing: Voiceless f p t k Voiced v bd g In addition, the sounds of 'm', 'n', 'r', and T are voiced, but they have no voiceless counterparts. Finally, all English vowels are voiced. Imagine you are an English spelling reformer who wants to rectify this misleading situation immedia ately. Implement the following function in Python, using the re .sub() method (from the built-in re package), to replace '-s' with '-2' in the appropriate cases. def fix_plurals (text: str) -
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
