def compare_users(epsilon, verbose): """Compare two users. - verbose: Enable or disable verbose printing. Each user will in turn have to type his text. Do not hit the ENTER (or RETURN) key until you are done, as it is how the input is validated. """ USER_1 = "Bro 1" USER_2 = "Bro 2" COMPARISON = " != " MarkovChain.set_epsilon = epsilon print "Please type your texts. Hit the ENTER key once you have finished typing." reader = MarkovTimeReader() print USER_1 chain_1 = reader.read() print USER_2 chain_2 = reader.read() if MarkovChain.are_similiar(chain_1, chain_2): COMPARISON = " == " print "\n" + USER_1 + COMPARISON + USER_2 if verbose: print "\nEpsilon used: " + str(epsilon) print "Markov chains:" print USER_1 + ":" chain_1.display() print USER_2 + ":" chain_2.display()
def compare_users(): """Compare two users.""" USER_1 = "Bro 1" USER_2 = "Bro 2" COMPARISON = " != " MarkovChain.set_epsilon = 0.1 print USER_1 chain_1 = __read_times() print USER_2 chain_2 = __read_times() if MarkovChain.are_similiar(chain_1, chain_2): COMPARISON = " == " print "\n" + USER_1 + COMPARISON + USER_2 print USER_1 + ":" chain_1.display() print USER_2 + ":" chain_2.display()