Re: Nice Automator article on O'Reilly
Re: Nice Automator article on O'Reilly
- Subject: Re: Nice Automator article on O'Reilly
- From: "Gary (Lists)" <email@hidden>
- Date: Fri, 06 May 2005 18:49:49 -0400
"David Marshall" wrote:
> Years
> ago I was able to write an absurd little command-line program that took
> as input an English word and returned its Pig Latin equivalent. (Try
> THAT in AppleScript!)
Sloppy, poor Pig Grammar and no punctuation but funny, nonetheless.
--
property vowels : {"a", "e", "i", "o", "u"}
property noPig : {"the"}
set mySentence to "Gary thinks the Xcode list reads like Martians at a
party"
set myWords to words of mySentence
set pigWords to {}
repeat with aWord in myWords
if (aWord is not in noPig) and [NOBREAK]
(text item 1 of aWord is not in vowels) and [NOBREAK]
(length of aWord > 3) then
set wti to text items of aWord
set moveChar to item 1 of wti
set aWord to (the rest of wti as text) & "-" & moveChar & "ay"
end if
copy aWord & " " to end of pigWords
end repeat
set pigSentence to (pigWords as text)
--> "ary-Gay hinks-tay the code-Xay ist-lay eads-ray ike-lay artians-May at
a arty-pay "
--
Gary
...a big fan of Ben Stiller's old "Pig Latin Lover" routine.
"ye-Bay, ye-Bay iss-May American ie-Pay..."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden