Skip to content

Instantly share code, notes, and snippets.

@Slater-Victoroff
Created August 21, 2013 20:42
Show Gist options
  • Save Slater-Victoroff/6299996 to your computer and use it in GitHub Desktop.
Save Slater-Victoroff/6299996 to your computer and use it in GitHub Desktop.
Determine the most random language
from pyfuzz.generator import random_regex
from guess_language import guessLanguageName
from collections import Counter
def randomness_histogram(iterations, length):
return Counter((guessLanguageName(random_regex(regex="[a-z \n]", length=length)) for i in xrange(length)))
print randomness_histogram(1000, 200).most_common(10) # returns the 10 most common languages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment