add counts to reload
This commit is contained in:
parent
0c206d5f4d
commit
0a730ae7f7
41
src/main.py
41
src/main.py
@ -2,25 +2,7 @@ import extract
|
|||||||
import search
|
import search
|
||||||
import insert
|
import insert
|
||||||
|
|
||||||
def prompt():
|
def start():
|
||||||
return input("Search Value: ")
|
|
||||||
|
|
||||||
def menu():
|
|
||||||
value = prompt()
|
|
||||||
while value != "quit" or value != "reload":
|
|
||||||
results = search.query(value)
|
|
||||||
if type(results) == dict:
|
|
||||||
print(results["content"])
|
|
||||||
else:
|
|
||||||
for doc in results:
|
|
||||||
print(doc["index"], " : ", doc["title"])
|
|
||||||
value = prompt()
|
|
||||||
if value == "reload":
|
|
||||||
extract.parse()
|
|
||||||
value = prompt()
|
|
||||||
|
|
||||||
def main():
|
|
||||||
|
|
||||||
extract.parse()
|
extract.parse()
|
||||||
print("Existing:", extract.existing)
|
print("Existing:", extract.existing)
|
||||||
print("Inserted:", extract.inserted)
|
print("Inserted:", extract.inserted)
|
||||||
@ -29,5 +11,26 @@ def main():
|
|||||||
|
|
||||||
menu()
|
menu()
|
||||||
|
|
||||||
|
def prompt():
|
||||||
|
return input("Search Value: ")
|
||||||
|
|
||||||
|
def menu():
|
||||||
|
value = prompt()
|
||||||
|
if value == "reload":
|
||||||
|
extract.parse()
|
||||||
|
value = prompt()
|
||||||
|
while value != "quit" or value != "reload":
|
||||||
|
results = search.query(value)
|
||||||
|
if type(results) == dict:
|
||||||
|
print(results["content"])
|
||||||
|
else:
|
||||||
|
for doc in results:
|
||||||
|
print(doc["index"], " : ", doc["title"])
|
||||||
|
value = prompt()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
start()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
Loading…
Reference in New Issue
Block a user