diff --git a/src/common/solutions.js b/src/common/solutions.js index 8c3f595..6152a3d 100644 --- a/src/common/solutions.js +++ b/src/common/solutions.js @@ -1170,7 +1170,14 @@ export const getReaderFriendlySummaryTokens = * @param {Solution} solution A solution. * @returns {string[]} All the sentences that can be generated from the given solution. */ -export const getUnfoldedSentences = lift(cartesianProduct(_.tokens).map(it.join(''))); +export const getUnfoldedSentences = lift( + cartesianProduct(_.tokens) + .map( + it.join('') + .trim() + .replaceAll(/(\s)\1+/g, '$1') + ) +); /** * @param {Solution} solution A solution.