|
|
|
@ -6,6 +6,7 @@ not_sus_regex = r"[Nn][o\']t[ a-z]*sus"
|
|
|
|
|
not_sus = re.compile(not_sus_regex, re.IGNORECASE) |
|
|
|
|
people = dict() |
|
|
|
|
companies = set() |
|
|
|
|
wonderful_blacklist = {'alice', 'hatter', 'rabbit', 'march mare'} |
|
|
|
|
# in_to_cm('6\'0"') == 182.88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -47,9 +48,6 @@ def lb_to_kg(lb):
|
|
|
|
|
return round(int(lb.split()[0]) * 0.4536, 2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wonderful_blacklist = {'alice', 'hatter', 'rabbit', 'march mare'} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def check_wonders(x): |
|
|
|
|
x = x.lower() |
|
|
|
|
for alice in wonderful_blacklist: |
|
|
|
@ -58,6 +56,19 @@ def check_wonders(x):
|
|
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def format_output(field): |
|
|
|
|
if not field: |
|
|
|
|
return '' |
|
|
|
|
elif type(field) in {list, tuple}: |
|
|
|
|
return ', '.join(list(map(format_output, field))) |
|
|
|
|
elif type(field) in {set}: |
|
|
|
|
return ', '.join(list(map(format_output, sorted(field)))) |
|
|
|
|
elif type(field) is float: |
|
|
|
|
return str(field).replace('.', ',') |
|
|
|
|
else: |
|
|
|
|
return str(field).replace('\n', ' ') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with open(r'mystery\crimescene') as f: |
|
|
|
|
scene = filter(lambda x: check_wonders(x), f.read().split(crime_separator)) |
|
|
|
|
|
|
|
|
@ -70,7 +81,6 @@ addresses = dict()
|
|
|
|
|
for streetname in os.listdir(r'mystery\streets'): |
|
|
|
|
with open(r'mystery\streets' + '\\' + streetname) as f: |
|
|
|
|
street = f.readlines() |
|
|
|
|
# ints=list(filter(lambda x: 'SEE INTER' in x, f.readlines())) |
|
|
|
|
ints = set() |
|
|
|
|
for nr in range(len(street)): |
|
|
|
|
if 'SEE INTER' in street[nr]: |
|
|
|
@ -104,7 +114,7 @@ with open(r'mystery\people') as f:
|
|
|
|
|
if people[name].addr in addresses: |
|
|
|
|
people[name].interview = addresses[people[name].addr]['interv'] |
|
|
|
|
people[name].not_sus = addresses[people[name].addr]['ns'] |
|
|
|
|
# else:print(people[name].addr, list(addresses)[4]) |
|
|
|
|
|
|
|
|
|
with open(r'mystery\vehicles') as f: |
|
|
|
|
for car in f.read().split('\n\n')[1:]: |
|
|
|
|
t = list(map(lambda x: x.replace('se Plate', 'te:').split(': ')[1].strip(), car.strip().split('\n'))) |
|
|
|
@ -117,20 +127,6 @@ with open(r'mystery\vehicles') as f:
|
|
|
|
|
people[name].make = make |
|
|
|
|
people[name].color = color |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def format_output(field): |
|
|
|
|
if not field: |
|
|
|
|
return '' |
|
|
|
|
elif type(field) in {list, tuple}: |
|
|
|
|
return ', '.join(list(map(format_output, field))) |
|
|
|
|
elif type(field) in {set}: |
|
|
|
|
return ', '.join(list(map(format_output, sorted(field)))) |
|
|
|
|
elif type(field) is float: |
|
|
|
|
return str(field).replace('.', ',') |
|
|
|
|
else: |
|
|
|
|
return str(field).replace('\n', ' ') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
f = open('people.csv', 'w') |
|
|
|
|
print('Full name;First;Last;G;Height;Age;Weight;Address;Sus;Make;Color;Plate;Membership;Interview', file=f) |
|
|
|
|
for name in sorted(people): |
|
|
|
|