PG: This /has/ a learning purpose. It's lost in "optional." The learning purpose is couched in machine generation of language, but the content/programming goals are also practice of old, learning new, and foreshadowing. The important "new" is the essential element of problem decomposition and abstraction: this problem is too difficult /without/ decomposing it, but perfectly tractable /with/ decomposition. And then, perfectly extensible to Spanish or...
Brian and Mary are considering possibly one day making these two pages into a non optional lab before or after Lab 4. --MF, 1/2/21
gossip, that writes. In this project, you will extend the computer's abilities with language by developing a reporter block,
plural, that takes a noun as input and correctly spells and outputs the plural
last letter ofwill report if, say, "2017" is its input.)
pluralblock. Build this much and test it out on at least "day" and "boss" and "medicine," to make sure it works correctly for those. If it does not, edit and fix it.
pluraldoes not work correctly. List the words you find. Organize that list, sorting the words into categories according to their last letter. For example, it will get wrong some words that end with the letter "h". Try to find many words it gets wrong.
pluralblock should now work correctly for "day" and "boss" and "moth," but it probably doesn't yet work correctly for the word "box":
pluralblock to make it work for words that end with "x". Test it to make sure it does work properly.
You can do the same for conjugating verbs in Spanish or some other language you choose. See the Take It Further section at the bottom.
The next two steps are worth learning—very useful for testing
plural and in more advanced work later on—but not essential for building
mapto test all the words on your list. Leave the slot in
pluralempty, as you see here. The
mapblock inserts each element of the list into that slot and reports a list of the results.
pluralwith. Try it. Now explain what the
mapblock does, in general.
last letter ofempty, as you see here. That is the placeholder for
keepto test each word the list. Explain what the