smilli / py-corenlp

Python wrapper for Stanford CoreNLP
353 stars 75 forks source link

Added a check for the server status #4

Closed alvations closed 8 years ago

alvations commented 8 years ago

I think an unambiguous error message would be better than getting a connection error, letting users think that they might have been timed-out, e.g. #3. So I added the assert checks.

smilli commented 8 years ago

Did you mean to close this?

alvations commented 8 years ago

Yeah, I closed it because there are other valid reasons for ConnectionError so I'm not sure whether that's a good way to check. I think i'll leave it closed unless you want to add the feature, if so feel free to merge it. I've tested the try-except and it does remind the user if the CoreNLP server is not started =)

smilli commented 8 years ago

Hmm, I bet this will be the most common reason for a ConnectionError though. So I'll merge it in for now, and can modify later if other reasons come up. Thanks! :)