PasswordPhraseGenerator/data/roll verb.py
2020-11-03 20:41:46 +01:00

28 lines
619 B
Python
Executable file

#!/usr/bin/env python3
import random, json
result = []
with open('verber.csv') as f:
lines = f.read().splitlines()
x = random.randint(0,len(lines))
for l in lines:
result.append(l.split(","))
if "/" in result[-1][3]:
temp = result[-1][:]
result[-1][3] = result[-1][3].replace(" / er","")
result[-1][4] = result[-1][4].replace(" / var","")
temp[3] = temp[3].replace("har / ","")
temp[4] = temp[4].replace("havde / ","")
result.append(temp)
#print(result[-1])
#if result[-1][1][-1] == "t":
# result[-1].insert(1,"t")
#else:
# result[-1].insert(1,"n")
#
print(json.dumps(result))
#print(result)