extract operation from editDistance