示例#1
0
def run():
    '''
    The main program, where we only call the tests function and the console one, also initializing the phones list.
    '''
    phones = []
    runTests(phones)
    console(phones)
示例#2
0
def menu():
    run = True
    while run:
        print("1 - расстояние Левенштейна матрично")
        print("2 - расстояние Левенштейна рекурсивно")
        print("3 - расстояние Дамерау-Левенштейна матрично")
        print("4 - расстояние Дамерау-Левенштейна рекурсивно")
        print("5 - все сразу (1-4)")
        print("6 - временной анализ")
        print("7 - тесты")

        action = input(" > ")

        if action == '1':
            printFlag = getPrintFlag()
            getDiatanceMatrix(levenshteinDistance_m, printFlag)
        elif action == '2':
            getDistanceRec(levenshteinDistance_r)
        elif action == '3':
            printFlag = getPrintFlag()
            getDiatanceMatrix(damerauLevenshteinDistance_m, printFlag)
        elif action == '4':
            getDistanceRec(damerauLevenshteinDistance_r)
        elif action == '5':
            distances()
        elif action == '6':
            timeTest()
        elif action == '7':
            runTests()
        else:
            run = False
示例#3
0
def main(argv):
	if len(argv) < 1:
		print "options:\n	python main.py test			# will run tests\n	python main.py visualize 	# will run visualizer"
	elif argv[0] == "visualize":
		graph = GraphVisualization()
		graph.run()
	elif argv[0] == "test":
		runTests()
	else:
		print "options:\n	python main.py test 		# will run tests\n	python main.py visualize 	# will run visualizer"
示例#4
0
def main():
	numInstr = int(sys.maxsize/100) #biggest working value = int(sys.maxsize/100)
	tickPerInstr = tests.compTime(algorithms.baseline, numInstr)/numInstr
	testValues = utility.getValues(len(sys.argv), sys.argv)
	algs = [
		algorithms.mergesort, 
		algorithms.heapsort, 
		algorithms.quicksort
	]

	if len(testValues) > 0:
		tests.runTests(tickPerInstr, algs, testValues)
示例#5
0
def start():
    account = []
    commands = {"list": UI_list, "sum": sumOfType, "max": max_type_day}
    modifiers = {
        "add": add_listing,
        "insert": insert_listing,
        "remove": remove_listing,
        "filter": filter_listings
    }
    runTests(account)
    oldAccount = []
    printAccount(account)
    printHello()
    while True:
        command = readCommand()
        if command[0] == "exit":
            print("The application is now closed.")
            return
        elif command[0] == "help":
            printHelp()
            continue
        elif command[0] in commands:
            commands[command[0]](account, command)
            continue
        elif command[0] == "replace":
            account = replace_listing(account, command, oldAccount)
            printAccount(account)
            continue
        elif command[0] in modifiers:
            modifiers[command[0]](account, command, oldAccount)
            printAccount(account)
            continue
        elif command[0] == "undo":
            account = mainUndo(account, oldAccount, command)
            printAccount(account)
            continue
        else:
            invalidCommand()
            continue
示例#6
0
from tests import runTests

runTests()
示例#7
0
def runTests():
	tests.runTests()