Generalized quasi-metric on strings

In this paper, we propose a generalized quasi-metric in spaces of strings, which is based on edit operations (insertion and deletions) and taking values as pairs of non-negative integers. We show that with such a generalization is possible to carry more information about similarity between strings than in the usual case where the distance between the strings is a simple real number. An algorithm for the calculation of this quasi-metric is presented and as well as an illustrative example of the application of this quasi-metric in handwritten digit classification. We also show some relations of this quasi-metric with the concept of subsequence of a string.