learntextvis / textkit

Command line tool for manipulating and analyzing text
MIT License
28 stars 6 forks source link

Can't pass multiple files in #13

Closed iros closed 8 years ago

iros commented 8 years ago

I've attempted the following formats and none of them work:

textkit text2words test_data/alice_short.txt test_data/word_tokens.txt
textkit text2words test_data/alice_short.txt,test_data/word_tokens.txt
textkit text2words test_data/{alice_short,word_tokens}.txt
textkit text2words test_data/*.txt

Is there a different way to pass them along?

iros commented 8 years ago

It looks like we'll need to change the way we intake file arguments to this:

@click.argument('text', type=click.Path(exists=True), nargs=-1)

I'm investigating...

iros commented 8 years ago

Ah!

If we replace the text.read() call with content = ''.join([open(f).read() for f in text]) combined with the above line, we should be able to do this. Going to PR.

vlandham commented 8 years ago

Just to complete the loop here. I think the usecase is valid - where someone has a directory of chapters or articles that should be treated as a single block of text.

We should be careful to distinguish in the docs the difference between that and the usecase of having multiple files you would want to compare. The later usecase we would still want (for now) to have separate calls to textkit - one for each document to compare.

vlandham commented 8 years ago

Can we close with #15 ?

iros commented 8 years ago

Yep! Closing.