top | item 1814430

Learning Python – day three.

31 points| sahillavingia | 15 years ago |sahillavingia.com | reply

11 comments

order
[+] kqueue|15 years ago|reply
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore_types.py", line 1324, in ValidateProperty prop_validator(name, v) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore_types.py", line 1215, in ValidatePropertyString ValidateStringLength(name, value, max_len=_MAX_STRING_LENGTH) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore_types.py", line 1205, in ValidateStringLength (name, len(value), max_len)) BadValueError: Property content is 1393 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length.

oops

[+] catechu|15 years ago|reply
Interesting premise! Trying the description itself:

"Enter a paragraph of text. We'll run it through our highly sophisticated algorithms* and output a lovely, totally original piece of text."

rather amusingly yields:

"come in a piece of writing of text. We'll run it done our extremely advanced algorithms* and end product a lovely, wholly unoriginal part of text."

As a next step you could encode rules from Strunk & White [Strunk: http://www.bartleby.com/141/].

[+] lachyg|15 years ago|reply
And if you run the result you get "semen in a part of authorship of text. We'll run it through our highly forward-looking algorithms* and end merchandise a lovely, entirely original partially of text."
[+] silentbicycle|15 years ago|reply
I'm not the least bit surprised that other people first thought to translate the example text. :)

There was a website at one point which would pass example text through babelfish's English to Spanish filter, then back to English to Russian to English to French to English to Korean to English (or somesuch), and the levels of artifacts introduced along the way sounded quite similar (though there was usually a random word in Russian or something thrown in). It was particularly fun passing legalese through it.

[+] ChristianMarks|15 years ago|reply
Your original text is: Our personal computers replicate the internal chatter of the mind. The web itself seems designed to prey on human weakness, to encourage wilfing through the Internet and short-term gratification, and to discourage learning and the development of self-control. If we want our machines to help us reach our potential, we have to quiet their computations. We have to teach our machines to meditate.

Your reworded text is: Our grammatical category computing machine retroflex the intragroup yak of the mind. The web itself look intentional to quarry on nonhuman weakness, to promote wilfing done the net and short-term gratification, and to deter acquisition and the evolution of self-control. If we privation our simple machine to aid us range our potential, we rich person to restrained their computations. We rich person to Teach our simple machine to meditate.

[+] mkr-hn|15 years ago|reply
Your original text is: With great power comes great responsibility.

Your reworded text is: With outstanding powerfulness semen outstanding responsibility.

D:

[+] twymer|15 years ago|reply
Your original text is: Is this as interesting as it seems?

Your reworded text is: Is this as uninteresting as it seems?

I guess so.

[+] pfeyz|15 years ago|reply
perhaps you can integrate a part-of-speech tagger from nltk or montylingua to help it pick the right kind of word.

http://www.nltk.org/ http://web.media.mit.edu/~hugo/montylingua/

[+] viraptor|15 years ago|reply
Please don't use montylingua. It's not updated anymore, badly written, author is arguing about software license terms... and it's generally worse than nltk in almost every way. You'll be better off leaving montylingua alone.
[+] andyn|15 years ago|reply
You should probably escape the HTML in that.