Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR cognitiveservices/data-plane/ContentModerator] Set language parameter as a non-required field for Screen Text API #2405

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def screen_text(
self, language, text_content_type, text_content, autocorrect=False, pii=False, list_id=None, classify=False, custom_headers=None, raw=False, callback=None, **operation_config):
self, text_content_type, text_content, language=None, autocorrect=False, pii=False, list_id=None, classify=False, custom_headers=None, raw=False, callback=None, **operation_config):
"""Detect profanity and match against custom and shared blacklists.

Detects profanity in more than 100 languages and match against custom
and shared blacklists.

:param language: Language of the terms.
:type language: str
:param text_content_type: The content type. Possible values include:
'text/plain', 'text/html', 'text/xml', 'text/markdown'
:type text_content_type: str
:param text_content: Content to screen.
:type text_content: Generator
:param language: Language of the text.
:type language: str
:param autocorrect: Autocorrect text.
:type autocorrect: bool
:param pii: Detect personal identifiable information.
Expand Down Expand Up @@ -80,7 +80,8 @@ def screen_text(

# Construct parameters
query_parameters = {}
query_parameters['language'] = self._serialize.query("language", language, 'str')
if language is not None:
query_parameters['language'] = self._serialize.query("language", language, 'str')
if autocorrect is not None:
query_parameters['autocorrect'] = self._serialize.query("autocorrect", autocorrect, 'bool')
if pii is not None:
Expand Down