Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -c option to split-sentences.perl #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jelmervdl
Copy link
Contributor

Some documents contain extremely long lines of generated text (most often links to search page results) that take forever to parse with the regular expressions in split-sentences.perl. Using the -c option these lines can be completely ignored.

Some documents contain extremely long lines of generated text (most often links to search page results) that take forever to parse with the regular expressions in split-sentences.perl. Using the -c option these lines can be completely ignored.
Comment on lines -271 to +279
$text = $text.$words[$i];
if (scalar(@words) > 0) {
$text = $text.$words[$i];
}
Copy link
Contributor Author

@jelmervdl jelmervdl Feb 17, 2021

Choose a reason for hiding this comment

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

It apparently also contains a fix for warnings caused by blank (or only whitespace) lines in the input.

@kpu
Copy link
Owner

kpu commented Feb 17, 2021

Ideally we'd replace buffering then splitting with splitting on the fly. Then if there's something long and no split we throw it out. Here I'm a bit concerned we're throwing out stuff that would correctly split. I understand your immediate need though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants