MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / penalize_name

Function penalize_name

tools/correct_test.php:47–63  ·  view source on GitHub ↗

######################### auxilary functions ################################## penalizes differing method names with 100

($f1, $f2)

Source from the content-addressed store, hash-verified

45########################## auxilary functions ##################################
46/// penalizes differing method names with 100
47function penalize_name($f1, $f2) {
48 # extract name (between whitepace and bracket
49 $tmp = trim(substr($f1, 0, strpos($f1, "(")));
50 $tmp = strtr($tmp, array("operator " => "operator", "operator\t" => "operator"));
51 $n1 = trim(substr($tmp, max(strrpos($tmp, " "), strrpos($tmp, "\t"))));
52
53 # extract name (between whitepace and bracket
54 $tmp = trim(substr($f2, 0, strpos($f2, "(")));
55 $tmp = strtr($tmp, array("operator " => "operator", "operator\t" => "operator"));
56 $n2 = trim(substr($tmp, max(strrpos($tmp, " "), strrpos($tmp, "\t"))));
57
58 if($n1 == $n2)
59 {
60 return 0;
61 }
62 return 100;
63}
64
65######################## parameter handling ####################################
66$verbose = false;

Callers 1

correct_test.phpFile · 0.85

Calls 1

substrFunction · 0.50

Tested by

no test coverage detected