An algorithm that can provide a solution for Step 2 will be a simpler version of the algorithm used to find the maximumprobability solution in Japanese morphological analysis (Nagata, 1994).
a solution can be obtained by applying a dynamic programming (DP) algorithm.