Language and Logo Savalai Vaikukals "Teaching a Turtle How To Spell" continues a long tradition of using Logo to explore natural language. People learn their own spoken language without instruction and develop an informal understanding of its rules. This intuitive knowledge provides the basis for learning formal rules of language, which can be expressed in Logo programs. Logo is well suited for natural language explorations because its data structures words and lists are analogous to the elements of natural language, and there are Logo procedures for manipulating these objects. In the example below we build a procedure that pluralizes English words.
to plural :singular output word :singular "s end
It works in many cases, ?print plural "dog dogs ?print plural "cat cats
but not all.
?print plural "fox foxs ?print plural "ax axs
So we need to modify it to take account of words ending with the letter x by adding a different pluralization rule.
to plural :singular if equal? last :singular "x [output word :singular "es] output word :singular "s end
?print plural "fox foxes ?print plural "ax axes
There are still many words that this program will not pluralize properly:
?print plural "mouse mouses
but we can continue to refine it, gradually constructing a comprehensive formulation of the rules of English pluralization.
For more about Logo and language go to http://www.logofoundation.org/logo/language.html An excellent book on this topic, unfortunately out of print, is Exploring Language with Logo by E. Paul Goldenberg and Wallace Feurzeig (MIT Press, 1987). Another good source of Logo language projects and ideas is The Logo Project Book by Alison Birch (Terrapin Software, 1986). |
|
|