Created
August 21, 2013 20:42
-
-
Save Slater-Victoroff/6299996 to your computer and use it in GitHub Desktop.
Determine the most random language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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