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

Feature: Add command line option to use stdin or text instead of file as a source #66

Closed
FrancisMurillo opened this issue Aug 13, 2016 · 5 comments
Labels

Comments

@FrancisMurillo
Copy link
Contributor

Nice library.

Using a temporary file is a little hastle but it would be nice if you can just plug it in as a command line option or pipe it.

@miso-belica
Copy link
Owner

Hi, thanks. Sumy provides the possibility to read from stdin. Just omit URL/File parameter and that's it :) Let me know if it's ok for you, or need sth else.

@FrancisMurillo
Copy link
Contributor Author

FrancisMurillo commented Aug 15, 2016

Doh!

Would it be pushing it if an option is what I really needed? I use this with Emacs and start-process, so if I pipe over it I still have to create a temporary buffer to hold the result which is really not that different if I stick with a temporary file. It if were an option, it would be simply plug and play.

@miso-belica
Copy link
Owner

Sorry, I don't think I understand. I don't know Emacs but IMHO you can stream text into sumy like ./stream_text | sumy lsa. Can you provide CLI interface that you expect from me in docopt format?

@FrancisMurillo
Copy link
Contributor Author

Emacs was just an example. If Python is a good example using the sh library, it would look something similar in Emacs

from sumy import sh

raw_text = 'Blah blah blah I like cats blah blah blah'

sumy('lex-rank', '--length', '5', '--text', my_raw_text)

The docopt format I think would be.

sumy (luhn | edmundson | lsa | text-rank | lex-rank | sum-basic | kl) [--length=<length>] [--language=<lang>] [--stopwords=<file_path>] [--format=<format>] --text=<text>

Maybe something like that. My actual call would then be

(setq my-raw-text "I love puspins")
(call-process "sumy" "lex-rank" "--length" "5" "--text" my-raw-text)

@miso-belica
Copy link
Owner

This was fixed in c382a42, thanks and nice day :)

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

No branches or pull requests

2 participants