Commit ecf25655 authored by cb's avatar cb

Cleaning code from last commit on adding an option to select names with letters

parent 888f8323
......@@ -24,20 +24,18 @@ lastnames = [items.split("\t")[0].title() for items in lastnames]
def rand_name(letters=True):
while True:
print(len(firstnames))
firstname = firstnames[random.randint(0, len(firstnames))]
lastname = lastnames[random.randint(0, len(lastnames))]
name = ' '.join([firstname, lastname])
# Loop till there is no non printable characters
if verify_name(name, letters):
print(name)
return name
def verify_name(name, letters=True):
'''
Brute Version of cleaning names:
Two options:
* Only printable characters (but we'll have some punctuations and (1) (2)...
* Only printable characters (but we'll have some punctuations and (1) (2)...)
* Only letters -> charset "abcdefghijklmnopqrstuvwxyz" + Uppercase
'''
if letters:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment