I, man, am regal - a German am I Never odd or even If I had a hi-fi Madam, I'm Adam Too hot to hoot No lemons, no melon Too bad I hid a boot Lisa Bonet ate no basil Warsaw was raw Was it a car or a cat I saw?
Rise to vote, sir Do geese see god? "Do nine men interpret?" "Nine men," I nod Rats live on no evil star Won't lovers revolt now? Race fast, safe car Pa's a sap Ma is as selfless as I am May a moody baby doom a yam?
Ah, Satan sees Natasha No devil lived on Lonely Tylenol Not a banana baton No "x" in "Nixon" O, stone, be not so O Geronimo, no minor ego "Naomi," I moan "A Toyota's a Toyota" A dog, a panic in a pagoda
Oh no! Don Ho! Nurse, I spy gypsies - run! Senile felines Now I see bees I won UFO tofu We panic in a pew Oozy rat in a sanitary zoo God! A red nugget! A fat egg under a dog! Go hang a salami, I'm a lasagna hog
I've heard this song so many times, and I never got that they were palindromes. Thank you for making me realize that this Weird Al song was just as brilliant as all his others; I just didn't understand it.
On August 26 2009 12:42 AcrossFiveJulys wrote: haha i was cracking up at "oozy rat in a sanitary zoo" and "nurse, I spy gypsies - run"
man i should write a program to find palendrome sentences
So would the program use a dictionary to find the latter half of a start you put?
For instance you enter, "Dog"
Parse each letter then use the hex to reverse it, search the dictionary to find "god"?
hex to reverse it? lol.
Yes, it's going to use a dict, and basically what i would do is start with a sentence fragment with a randomly chosen word, and set a randomly chosen word count limit on the sentence. Then, begin adding words that still allow the sentence to form a possible palindrome (i.e., look at a word, check if palindrome is still possible, if so add it, if not remove it). If no words fit the criteria, remove the last word added and try again. Basically, a randomized backtracking search through the dictionary of words.
to make it as efficient as possible, as always you would need to use proper search methods and data structures.
this is just the way i would hack out a quick program to spit out random palindrome sentences. it might make sense to use a grammar parsing program to check the validity of sentences as they are built so as to avoid garbage sentences.
I, man, am regal - a German am I Never odd or even If I had a hi-fi Madam, I'm Adam Too hot to hoot No lemons, no melon Too bad I hid a boot Lisa Bonet ate no basil Warsaw was raw Was it a car or a cat I saw?
Rise to vote, sir Do geese see god? "Do nine men interpret?" "Nine men," I nod Rats live on no evil star Won't lovers revolt now? Race fast, safe car Pa's a sap Ma is as selfless as I am May a moody baby doom a yam?