Skip to content

Commit 0ab6df0

Browse files
authored
Merge pull request #97 from rosette-api/WS-2589-remove-genre-from-entities-example
WS-2589: removing genre from doc & future print_function
2 parents f8d2f7a + 91b2e2b commit 0ab6df0

25 files changed

+29
-57
lines changed

examples/address_similarity.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to get match score (similarity) of two addresses.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -36,4 +35,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3635
if __name__ == '__main__':
3736
ARGS = PARSER.parse_args()
3837
RESULT = run(ARGS.key, ARGS.url)
39-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
38+
print(RESULT)

examples/categories.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
Example code to call Rosette API to get the category of a document (at a given URL).
55
"""
6-
from __future__ import print_function
76

87
import argparse
98
import json
@@ -48,4 +47,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
4847
if __name__ == '__main__':
4948
ARGS = PARSER.parse_args()
5049
RESULT = run(ARGS.key, ARGS.url)
51-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
50+
print(RESULT)

examples/entities.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to get entities from a piece of text.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -27,7 +26,7 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2726
entities_text_data = "The Securities and Exchange Commission today announced the leadership of the agency’s trial unit. Bridget Fitzpatrick has been named Chief Litigation Counsel of the SEC and David Gottesman will continue to serve as the agency’s Deputy Chief Litigation Counsel. Since December 2016, Ms. Fitzpatrick and Mr. Gottesman have served as Co-Acting Chief Litigation Counsel. In that role, they were jointly responsible for supervising the trial unit at the agency’s Washington D.C. headquarters as well as coordinating with litigators in the SEC’s 11 regional offices around the country."
2827
params = DocumentParameters()
2928
params["content"] = entities_text_data
30-
params["genre"] = "social-media"
29+
3130
try:
3231
return api.entities(params)
3332
except RosetteException as exception:
@@ -43,4 +42,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
4342
if __name__ == '__main__':
4443
ARGS = PARSER.parse_args()
4544
RESULT = run(ARGS.key, ARGS.url)
46-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
45+
print(RESULT)

examples/info.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to get information such as version and build
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -32,4 +31,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3231
if __name__ == '__main__':
3332
ARGS = PARSER.parse_args()
3433
RESULT = run(ARGS.key, ARGS.url)
35-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
34+
print(RESULT)

examples/language.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to determine the language of a piece of text.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -36,4 +35,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3635
if __name__ == '__main__':
3736
ARGS = PARSER.parse_args()
3837
RESULT = run(ARGS.key, ARGS.url)
39-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
38+
print(RESULT)

examples/language_multilingual.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to determine the language of a piece of text.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -38,4 +37,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3837
if __name__ == '__main__':
3938
ARGS = PARSER.parse_args()
4039
RESULT = run(ARGS.key, ARGS.url)
41-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
40+
print(RESULT)

examples/morphology_complete.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to get the complete morphological analysis of a piece of text.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -42,4 +41,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
4241
if __name__ == '__main__':
4342
ARGS = PARSER.parse_args()
4443
RESULT = run(ARGS.key, ARGS.url)
45-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
44+
print(RESULT)

examples/morphology_compound-components.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to get de-compounded words from a piece of text.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -42,4 +41,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
4241
if __name__ == '__main__':
4342
ARGS = PARSER.parse_args()
4443
RESULT = run(ARGS.key, ARGS.url)
45-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
44+
print(RESULT)

examples/morphology_han-readings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to get Chinese readings of words in a piece of text.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -41,4 +40,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
4140
if __name__ == '__main__':
4241
ARGS = PARSER.parse_args()
4342
RESULT = run(ARGS.key, ARGS.url)
44-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
43+
print(RESULT)

examples/morphology_lemmas.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
Example code to call Rosette API to get lemmas for words in a piece of text.
44
"""
5-
from __future__ import print_function
65

76
import argparse
87
import json
@@ -42,4 +41,4 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
4241
if __name__ == '__main__':
4342
ARGS = PARSER.parse_args()
4443
RESULT = run(ARGS.key, ARGS.url)
45-
print(json.dumps(RESULT, indent=2, ensure_ascii=False, sort_keys=True).encode("utf8"))
44+
print(RESULT)

0 commit comments

Comments
 (0)