Let we determine the alignment between sentence s j and each sentence s k ∈ C i such that k < j according to the following dynamic programming formulation (Cormen, Leiserson, and Rivest 1990, pages 314-319): where The matching score S a,b is calculated on the generalized sentences s k and s j as follows: where t k,a and t j,b are the a-th and b-th tokens of s k and s j , respectively.
the matching score equals 1 if the a-th and the b-th tokens of the two generalized sentences have the same word class.