Skip to content

Commit 6149667

Browse files
committed
changing AlchemyLanguage max_keywords to max_items for consistency
1 parent e49d442 commit 6149667

File tree

3 files changed

+14
-123
lines changed

3 files changed

+14
-123
lines changed

examples/concept_insights_v2.py

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

test/test_examples.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
# tests to exclude
1313
excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py',
14-
'alchemy_language_v1.py', 'alchemy_vision_v1.py']
14+
'alchemy_language_v1.py', 'alchemy_vision_v1.py',
15+
'concept_insights_v2.py']
1516

1617
# examples path. /examples
1718
examples_path = join(dirname(__file__), '../', 'examples', '*.py')

watson_developer_cloud/alchemy_language_v1.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,21 @@ def authors(self, html=None, url=None, language=None):
3434
return self._alchemy_html_request('GetAuthors', html=html, url=url, params=params)
3535

3636
def keywords(self, html=None, text=None, url=None, strict_extract_mode=False, sentiment=False,
37-
show_source_text=False, max_keywords=50, language=None):
37+
show_source_text=False, max_items=None, language=None, max_keywords=50):
38+
"""
39+
:param html: HTML input
40+
:param text: Text input
41+
:param url: URL input
42+
:param max_items: The number of results to return (default 50)
43+
:param max_keywords: deprecated, use max_items instead
44+
:return: A JSON object with extracted keywords from the source document
45+
"""
46+
if not max_items:
47+
max_items = max_keywords
3848
params = {'keywordExtractMode': 'strict' if strict_extract_mode else 'normal',
3949
'sentiment': sentiment,
4050
'showSourceText': show_source_text,
41-
'maxRetrieve': max_keywords,
51+
'maxRetrieve': max_items,
4252
'language': language}
4353
return self._alchemy_html_request('GetRankedKeywords', html=html, text=text, url=url, params=params)
4454

0 commit comments

Comments
 (0)