Adds a term_distances method.