Lexical transformation tasks like plural to singular conversion can often be solved in two extreme ways: 1. Create a lexicon and store all known pairs in the lexicon. If the task is small and does not contain a lot of ambiguity (two or more singulars with the same plural) then this could work well. The disadvantage is that every word needs to be part of the lexicon. 2. Find a set of rules which cover as many pairs as possible. This will lead to smaller programs because a single rule can cover many pairs. However, the interaction between the different rules could become a problem. Rule A might block the application of rule B. For this task, we need both approaches. A program solving this task would take the following steps: a. read a line from the keyboard b. as long as there is some input c. check if the input is in the lexicon, put singular in variable d. otherwise check if rule 1 applies, put singular in variable e. otherwise check if rule 2 applies, put singular in variable ... f. apply default rule, put singular in variable g. print contents of singular variable h. read a line for the keyboard The lexicon can be implemented as a hash with plurals as keys and singulars as values. Checking if a rule applies will be done with "if" and with regular expressions, for example by checking if a plural ends with "hes". Applying a rule can be implemented with the =~ operator and the s/// operator, for example by replacing "hes" at the end of a plural by "h". Make sure that the most general rule is the last one to be checked. For example, you might need the rules "hes"->"h" and "s"->"". The "hes" rule should be applied before the "s" rule because otherwise a word like "matches" would be converted to "matche". The default rule is the rule that is applied when no other rule is appropriate. For this task the rule 'singular = plural' would be a good default rule. Finally, it is a good idea to thoroughly test the program because adding a single rule could radically change its output. Make a list with twenty different cases that you want the program to be able to handle and test your program with these test cases before you submit it.