We use a modified version of the prefixspan algorithm (Pei et al., 2004) to generate subsequences from a text snippet.
we use the constraints (ii)-(iv) to prune the search space of candidate subsequences.