Skip to content

Commit b0306ff

Browse files
committed
Update corenlp.py
1 parent cfae0b2 commit b0306ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pycorenlp/corenlp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ def __init__(self, server_url):
1010
def annotate(self, text, properties=None):
1111
if not properties:
1212
properties = {}
13+
14+
# Checks that the Stanford CoreNLP server is started.
15+
assert requests.get(nlp.server_url).ok, \
16+
str('Check whether you have started the CoreNLP server, e.g. \n'
17+
'$ cd stanford-corenlp-full-2015-12-09/ \n'
18+
'$ java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer')
19+
1320
r = requests.get(
1421
self.server_url, params={
1522
'properties': str(properties)

0 commit comments

Comments
 (0)