feat: Initial commit
This commit is contained in:
22
indice.py
Normal file
22
indice.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from sys import exit
|
||||
|
||||
from wordutils import clean
|
||||
|
||||
index = {}
|
||||
|
||||
try:
|
||||
inf = open("indexdata.txt", "r")
|
||||
except FileNotFoundError:
|
||||
exit("File not found")
|
||||
|
||||
for line in inf:
|
||||
fields = line.split(":")
|
||||
key = fields[0].strip()
|
||||
word = fields[1].strip()
|
||||
|
||||
if key not in index:
|
||||
index[key] = set()
|
||||
|
||||
index[key].add(word)
|
||||
|
||||
print(index)
|
||||
Reference in New Issue
Block a user