added method to transform event.data into a string to compute the edit distance