We further define the distance between two parsing actions as follows: it is either  is the Hamming distance, and Computing the editing distance (3) requires dynamic programming and it is computationally extensive.
to speed up computation, we can choose to ignore the difference in contexts, or in other words, (4) becomes  the sample density is defined as the inverse of its average distance to other samples.