Let's say we have a set of wordslabels of the same length, and we need to find the distance between wordsthem.
In the case of binary wordslabels, one can use the Hamming distance. For example, if $a = 01101$$l_1 = 01101$ and $b = 00111$$l_2 = 00111$, then $d (a, b) = 2$$d(l_1, l_2) = 2$.
In my case, wordslabels are formed from the alphabet $\{a, b, c, d, e\}$$A=\{a, b, c, d, e\}$, so the length of the alphabet is $5$$|A|=5$, and the length of each wordlabel is $4$$n=4$.
In my case, an ordinal scale is applicable for letters, i.e. from alphabet $A$:
$$a <b <c <d <e.$$$$a < b < c < d < e.$$
Examples of wordslabels: deed
, aaaa
, aaad
, aaae
, dada
, cccd
.
Edit.Edit. The Hemming distance for three wordslabels aaaa
, aaad
, aaae
gives $d(aaaa, aaad) = d(aaaa, aaae)$$$d(aaaa, aaad) = d(aaaa, aaae)$$ but I am looking for a metric which will distinguish '$d$' and '$e$' and return $d(aaaa, aaad)<d(aaaa, aaae)$$$d(aaaa, aaad)<d(aaaa, aaae)$$ because $d<e$.
Edit 2.
For creating a label we use a threshold $T \in \mathbf{R}$ and apply the next function for the $i$-th element of $X=(x_1, x_2, \ldots, x_n)$: \begin{equation} f(x_i) = \begin{cases} a, & x_i \leq -T, \\ b, & -T < x_i \leq 0, \\ c, & x_i = 0, \\ d, & 0 < x_i \leq T, \\ e, & x_i >T. \ \end{cases} \end{equation} Finally, we use the concatination operator $\&$, for example, $a \& a \& a \& a= aaaa$.
Question. What a metric can I use to calculate the distance between wordslabels?