Skip to content

Commit c581263

Browse files
cp2bostonLi Xu
authored andcommitted
Removed entities/linked (#59)
* Removed entities/linked - Removed example - Removed resolve_entities parameter and check - Updated README - tests pass * Removed unnecessary doc directory - updated .gitignore to ignore doc/ directory * Removed linked entities in comment
1 parent 1874e6a commit c581263

File tree

7 files changed

+6
-637
lines changed

7 files changed

+6
-637
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ __pycache__/
2323

2424
# Distribution / packaging
2525
.Python
26+
doc/
2627
env/
2728
build/
2829
develop-eggs/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The samples use the following procedure:
6565
`NameSimilarityParameters`; Other parameters are optional.
6666

6767
6. Invoke the `API` method for the endpoint you are calling. The methods are
68-
* `entities(linked)` where `linked` is `False` for entity extraction and `True` for entity linking.
68+
* `entities()`
6969
* `categories()`
7070
* `sentiment()`
7171
* `language()`

doc/api.html

Lines changed: 0 additions & 576 deletions
This file was deleted.

examples/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Each example, when run, prints its output to the console.
2424
| ------------- |------------- |
2525
| categories.py | Gets the category of a document at a URL |
2626
| entities.py | Gets the entities from a piece of text |
27-
| entities_linked.py | Gets the linked (to Wikipedia) entities from a piece of text |
2827
| info.py | Gets information about Rosette API |
2928
| language.py | Gets the language of a piece of text |
3029
| matched-name.py | Gets the similarity score of two names |

examples/entities_linked.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

rosette/api.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -777,23 +777,16 @@ def morphology(self, parameters, facet=MorphologyOutput.COMPLETE):
777777
@return: A python dictionary containing the results of morphological analysis."""
778778
return EndpointCaller(self, "morphology/" + facet).call(parameters)
779779

780-
def entities(self, parameters, resolve_entities=False):
780+
def entities(self, parameters):
781781
"""
782782
Create an L{EndpointCaller} to identify named entities found in the texts
783-
to which it is applied and call it. Linked entity information is optional, and
784-
its need must be specified at the time the operator is created.
783+
to which it is applied and call it.
785784
@param parameters: An object specifying the data,
786785
and possible metadata, to be processed by the entity identifier.
787786
@type parameters: L{DocumentParameters} or L{str}
788-
@param resolve_entities: Specifies whether or not linked entity information will
789-
be wanted.
790-
@type resolve_entities: Boolean
791787
@return: A python dictionary containing the results of entity extraction."""
792-
if resolve_entities:
793-
warnings.warn("entities(params,resolve_entities) is deprecated and replaced by entities(params).", DeprecationWarning)
794-
return EndpointCaller(self, "entities/linked").call(parameters)
795-
else:
796-
return EndpointCaller(self, "entities").call(parameters)
788+
789+
return EndpointCaller(self, "entities").call(parameters)
797790

798791
def categories(self, parameters):
799792
"""

tests/test_rosette_api.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -323,21 +323,6 @@ def test_the_entities_endpoint(api, json_response, doc_params):
323323
httpretty.disable()
324324
httpretty.reset()
325325

326-
# Test the entities/linked endpoint
327-
328-
329-
def test_the_entities_linked_endpoint(api, json_response, doc_params):
330-
httpretty.enable()
331-
httpretty.register_uri(httpretty.POST, "https://api.rosette.com/rest/v1/info",
332-
body=json_response, status=200, content_type="application/json")
333-
httpretty.register_uri(httpretty.POST, "https://api.rosette.com/rest/v1/entities/linked",
334-
body=json_response, status=200, content_type="application/json")
335-
336-
result = api.entities(doc_params, True)
337-
assert result["name"] == "Rosette API"
338-
httpretty.disable()
339-
httpretty.reset()
340-
341326
# Test the categories endpoint
342327

343328

0 commit comments

Comments
 (0)