Add trim by sentence.

Created on 8 May 2023, about 1 year ago
Updated 24 May 2023, about 1 year ago

Problem/Motivation

Currently, the Smart Trim module only allows for text trimming based on the number of words or characters. However, there are cases where it would be useful to trim text based on the number of sentences, such as when displaying snippets of long articles or product descriptions.

Proposed resolution

To address this limitation, we propose adding a new option to Smart Trim that allows users to specify the maximum number of sentences to display. This new functionality will be based on the existing word-trimming algorithm but will count sentences instead of words. The algorithm will identify sentence boundaries using common sentence-ending punctuation (such as periods, question marks, and exclamation marks), and will ensure that the trimmed text always ends on a complete sentence.

✨ Feature request
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine snig

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024