next up previous
Next: About this document ... Up: In the Laboratory: Pig Previous: Implementation

Optional Refinement

Because it's redundant in Pig Latin to have words like ``myyay'' that contain ``yy,'' revise your program so that it converts ``my'' and ``why'' into ``myay'' and ``whyay'' instead of ``myyay'' and ``whyyay.'' To do this, you could treat English words that end in ``y'' as a special case in your translate() method. Think about what sort of Java expression you would use to determine if a word's last letter is 'y'? What String method(s) will you need to form this expression?



Ralph Morelli {Faculty}
12/22/1999