Skip to content

Commit 19a8486

Browse files
author
Hannah
committed
style fixes
1 parent 38323dc commit 19a8486

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

examples/entities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def run(key, altUrl='https://api.rosette.com/rest/v1/'):
1818
params = DocumentParameters()
1919
params["content"] = entities_text_data
2020
params["genre"] = "social-media"
21-
return api.entities(params)
21+
return api.entities(params)
2222

2323
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description='Calls the ' + os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
2424
parser.add_argument('-k', '--key', help='Rosette API Key', required=True)

examples/entities_linked.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def run(key, altUrl='https://api.rosette.com/rest/v1/'):
1919
params = DocumentParameters()
2020
params["content"] = entities_linked_text_data
2121
params["genre"] = "social-media"
22-
return api.entities(params, True) # entity linking is turned on
22+
#This syntax is deprecated, call api.entities(params)
23+
return api.entities(params, True)
2324

2425

2526
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description='Calls the ' + os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')

rosette/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from socket import gaierror
2828
import requests
2929
import re
30+
import warnings
3031

3132
_BINDING_VERSION = '1.1.1'
3233
_GZIP_BYTEARRAY = bytearray([0x1F, 0x8b, 0x08])
@@ -765,12 +766,11 @@ def entities(self, parameters, resolve_entities=False):
765766
@type resolve_entities: Boolean
766767
@return: A python dictionary containing the results of entity extraction."""
767768
if resolve_entities:
768-
warnings.warn_explicit("the /entities/linked endpoint is replaced by /entities.", DeprecationWarning)
769+
warnings.warn_explicit("entities(params,resolve_entities) is deprecated and replaced by entities(params).", DeprecationWarning)
769770
return EndpointCaller(self, "entities/linked").call(parameters)
770771
else:
771772
return EndpointCaller(self, "entities").call(parameters)
772773

773-
774774
def categories(self, parameters):
775775
"""
776776
Create an L{EndpointCaller} to identify the category of the text to which

0 commit comments

Comments
 (0)