uutils / uutils/coreutils

[Feature] fold on punctuation

Open
#13,316 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

U - fold
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

I found folding on punctuation desirable for Piper TTS work.

Would uutils consider adding a -p --punctuation arg to fold with fallbacks like this isolated working example?

While the example is English centric, the existing -s --spaces arg is also not applicable to some non English (Chinese, Japanese, etc). If the is_alphanumeric catch all is not ideal for other languages specific punctuation could be added later; Spanish(¿¡), Chinese(。、), etc. (maybe based on locale or maybe as an always on check)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/uu/fold/src/fold.rs around the fold implementation and compare the isolated Rust example in fold4 at rust/src/main.rs around line 67. Define the expected -p/--punctuation behavior, including non-English punctuation considerations, then verify that the flag folds at the requested boundaries and is covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.