def test2(t = None): """Test str()""" modifier = 1 t,t2 = (t, translateTree(t)) if t else createTrees() s = str(t2) if s[-1] != ';': modifier = 0.95 s += ';' t3 = parseNewick_sol.parseNewick(s) return modifier*float(sameTrees(t,t3))
def checkStr(s): try: T1 = parseNewick_sol.parseNewick(s) T2 = parseNewick.parseNewick(s) S = compareTree(T1, T2) if 0 in S: return 0 score = 1 if 1 in S: score -= 0.15 if 2 in S: score -= 0.1 if 3 in S: score -= 0.25 if 4 in S: score -= 0.25 return score except Exception as e: return 0
def checkStr(s): try: T1 = parseNewick_sol.parseNewick(s) T2 = parseNewick.parseNewick(s) S = compareTree(T1,T2) if 0 in S: return 0 score = 1 if 1 in S: score -= 0.15 if 2 in S: score -= 0.1 if 3 in S: score -= 0.25 if 4 in S: score -= 0.25 return score except Exception as e: return 0