예제 #1
0
    indexOption = input("What's your choice [1/2]: ")

    if indexOption == '1':
        indexSource = IndexSource.new
        break
    elif indexOption == '2':
        indexSource = IndexSource.stored
        break

    print("Invalid option '" + indexOption + "', please choose again.")


# Index
index = Index(indexSource, ParserType.wordprocessing)
print(len(index.getDictionary().getTerms().keys()))
print("Time for creating the index: " + index.getTimer().getElapsedMillisecondsString() + "\n")

# Query
print("Query execution:")
print("You can leave the program by entering 'exit()'.\n")

queryParser = Parser(index.getParserType())
queryExecutor = QueryExecutor(index)

while True:
    query = input("Query: ")

    if query == "exit()":
        break

    # Execution of the query