Skip to content

Instantly share code, notes, and snippets.

@erlehmann
Created July 11, 2010 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erlehmann/471610 to your computer and use it in GitHub Desktop.
Save erlehmann/471610 to your computer and use it in GitHub Desktop.
import zlib
sentences = [
'Vor einem Jahr habe ich mir fuer ca. 300 Euro die Casio Exilim Kamera gekauft.',
'Ich bonerte und sturbierte, bis mein Sack leer war. MEIN SACK MEIN SACK MEIN SACK',
'SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE SAGE'
]
for s in sentences:
ratio = len(s) / len(zlib.compress(s))
if ratio <3:
print s
else:
print "(ZIP)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment