generalized TurkDistance