Skip to content

Commit b2d6f0e

Browse files
committed
do not hide json parsing errors
1 parent 8fb3d44 commit b2d6f0e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pycorenlp/corenlp.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ def annotate(self, text, properties=None):
3535
self.server_url, params={
3636
'properties': str(properties)
3737
}, data=data, headers={'Connection': 'close'})
38-
output = r.text
3938
if ('outputFormat' in properties
4039
and properties['outputFormat'] == 'json'):
41-
try:
42-
output = json.loads(output, strict=True)
43-
except:
44-
pass
45-
return output
40+
return json.loads(r.text, strict=True)
41+
return r.text
4642

4743
def tokensregex(self, text, pattern, filter):
4844
return self.regex('/tokensregex', text, pattern, filter)

0 commit comments

Comments
 (0)