Technically Speaking The Pig Latin Rules That We Have Established

Technically speaking, the Pig Latin rules that we have established apply only to words, not phrases. However, your current piglatin.html page does nothing to prevent users from entering a string containing spaces. Thus, a user could enter ‘foo bar’ in the text box and be told that the Pig Latin translation is ‘oo barfay’.
Modify your PigLatin function so that, before the string is translated, the function checks whether the input is a single word (i.e., whether it contains any spaces). If there are spaces in the input, the function should return the string “ILLEGAL INPUT”.
[The Classify function you wrote in Exercise 15.5 should prove useful here.]

Posted in Uncategorized