Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ptx: implement -S/--sentence-regexp#9682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
CrazyRoka wants to merge1 commit intouutils:main
base:main
Choose a base branch
Loading
fromCrazyRoka:ptx-implement-sentence-regexp

Conversation

@CrazyRoka
Copy link

Description
This PR implements the-S / --sentence-regexp flag forptx, bringing it closer to full GNU compatibility.

Previously,ptx only supported splitting input by lines. This change allows users to define a custom regular expression to split the input into sentences, as specified in the GNU documentation.

Tests
GNU Compatibility: This fixes the previously failingtests/ptx/ptx.pl test caseS-infloop.
Unit Tests: Added new Rust unit tests intests/by-util/test_ptx.rs.

}
if matches.contains_id(options::SENTENCE_REGEXP){
returnErr(PtxError::NotImplemented("-S").into());
ifletSome(regex) = matches.get_one::<String>(options::SENTENCE_REGEXP){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I am not entirely sure about this and I don't think this is something that can be resolved within the scope of a PR but I was doing some investigation into why we use the onig crate and it appears it because that the GNU regex has some fundamental differences with the Regex that is used in the expr utility.

If that regex is the same regex used here it would be good to leave a comment explaining that there is still the todo that the regex that is being used is not fully compatible with the GNU implementation.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)Congrats! The gnu test tests/tail/inotify-dir-recreate is now passing!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@ChrisDrydenChrisDrydenChrisDryden left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@CrazyRoka@ChrisDryden

[8]ページ先頭

©2009-2025 Movatter.jp