(self, text, annotators=None, output_format=None, properties=None)
| 23 | self.client.stop() |
| 24 | |
| 25 | def annotate(self, text, annotators=None, output_format=None, properties=None): |
| 26 | try: |
| 27 | result = self.client.annotate(text, annotators, output_format, properties) |
| 28 | except (corenlp.client.PermanentlyFailedException, |
| 29 | requests.exceptions.ConnectionError) as e: |
| 30 | print('\nWARNING: CoreNLP connection timeout. Recreating the server...', file=sys.stderr) |
| 31 | self.client.stop() |
| 32 | self.client.start() |
| 33 | result = self.client.annotate(text, annotators, output_format, properties) |
| 34 | |
| 35 | return result |
| 36 | |
| 37 | |
| 38 | _singleton = None |
no outgoing calls
no test coverage detected