Porting the DoubleEndedIterator
of segmenters
#26
Labels
enhancement
New feature or request
Milestone
DoubleEndedIterator
of segmenters
#26
The original Rust library implements the
DoubleEndedIterator
trait, which, unlike JavaScript's standard iterator, allows for reverse traversal (next_back()
)The original goal was to be a lightweight alternative to
Intl.Segmenter
, so I intentionally removed it. But as I can see some issues in the ecosystem like flmnt/graphemer#10, it is one of the most common requirements in scenarios such as implementing an editor. Because, it would be crazy to re-traverse the entire text forward to find just the previous cursor. To avoid that, the user would have to implement their own cursor history, which is inefficient.However, that significantly inflates the bundle size, which the generator cannot represent.
I will improved the class version implementation and expose it as a separate bundle entry (e.g
unicode-segmenter/advanced/double-ended/grapheme
)The text was updated successfully, but these errors were encountered: