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

Make its input and output Linux pipe friendly #17

Open
ibnesayeed opened this issue Nov 12, 2019 · 5 comments
Open

Make its input and output Linux pipe friendly #17

ibnesayeed opened this issue Nov 12, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@ibnesayeed
Copy link
Member

The tool should accept input from the STDIN and generate output to the STDOUT so that it can work nicely with other Unix tools.

@ibnesayeed ibnesayeed added the enhancement New feature or request label Nov 12, 2019
@phonedude
Copy link
Member

+1

I also noted this with "scraper" in yesterday's telecon too.

@anwala
Copy link
Member

anwala commented Feb 23, 2022

@ibnesayeed,

For a single text collection, this shouldn't be a problem.

However, for multiple text collections, we'd need an unambiguous boundary marker to determine the end of "text collection 1" and the beginning of another. When reading separate files, this is not a problem because the files serve as natural text collection boundaries.

For a single text collection, is this usage what you have in mind?:
$ sumgram "The eye of Category 4 Hurricane Harvey..."

@ibnesayeed
Copy link
Member Author

For a single text collection, is this usage what you have in mind?:
$ sumgram "The eye of Category 4 Hurricane Harvey..."

No, this style of argument was not the intent, because that would be ambiguous and no one wants to supply a long text as an argument. Please let the argument reserved for file/folder paths and use STDIN as input instead, so something like the following works:

$ echo "The eye of Category 4 Hurricane Harvey..." | sumgram

@ibnesayeed
Copy link
Member Author

FYI, many things that you trying to do with the input (e.g., reading from STDIN, one or more files as arguments, compressed files, etc.) can be handled more easily using the fileinput module in the standard Python library.

@anwala
Copy link
Member

anwala commented Feb 27, 2022

Oh, I see, I misunderstood. Thanks a lot for the clarification.
I'll ensure you can read text from STDIN & consider using fileinput.

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

No branches or pull requests

3 participants