@@ -188,25 +188,22 @@ def analyze_sentiment(self, document, encoding_type=None, options=None):
188188 :exc:`google.gax.errors.GaxError` if the RPC is aborted.
189189 :exc:`ValueError` if the parameters are invalid.
190190 """
191- # Create the request object.
192191 request = language_service_pb2 .AnalyzeSentimentRequest (
193192 document = document , encoding_type = encoding_type )
194193 return self ._analyze_sentiment (request , options )
195194
196- def analyze_entities (self , document , encoding_type , options = None ):
195+ def analyze_entities (self , document , encoding_type = None , options = None ):
197196 """
198197 Finds named entities (currently proper names and common nouns) in the text
199198 along with entity types, salience, mentions for each entity, and
200199 other properties.
201200
202201 Example:
203202 >>> from google.cloud.gapic.language.v1beta2 import language_service_client
204- >>> from google.cloud.gapic.language.v1beta2 import enums
205203 >>> from google.cloud.proto.language.v1beta2 import language_service_pb2
206204 >>> client = language_service_client.LanguageServiceClient()
207205 >>> document = language_service_pb2.Document()
208- >>> encoding_type = enums.EncodingType.NONE
209- >>> response = client.analyze_entities(document, encoding_type)
206+ >>> response = client.analyze_entities(document)
210207
211208 Args:
212209 document (:class:`google.cloud.proto.language.v1beta2.language_service_pb2.Document`): Input document.
@@ -221,24 +218,24 @@ def analyze_entities(self, document, encoding_type, options=None):
221218 :exc:`google.gax.errors.GaxError` if the RPC is aborted.
222219 :exc:`ValueError` if the parameters are invalid.
223220 """
224- # Create the request object.
225221 request = language_service_pb2 .AnalyzeEntitiesRequest (
226222 document = document , encoding_type = encoding_type )
227223 return self ._analyze_entities (request , options )
228224
229- def analyze_entity_sentiment (self , document , encoding_type , options = None ):
225+ def analyze_entity_sentiment (self ,
226+ document ,
227+ encoding_type = None ,
228+ options = None ):
230229 """
231230 Finds entities, similar to ``AnalyzeEntities`` in the text and analyzes
232231 sentiment associated with each entity and its mentions.
233232
234233 Example:
235234 >>> from google.cloud.gapic.language.v1beta2 import language_service_client
236- >>> from google.cloud.gapic.language.v1beta2 import enums
237235 >>> from google.cloud.proto.language.v1beta2 import language_service_pb2
238236 >>> client = language_service_client.LanguageServiceClient()
239237 >>> document = language_service_pb2.Document()
240- >>> encoding_type = enums.EncodingType.NONE
241- >>> response = client.analyze_entity_sentiment(document, encoding_type)
238+ >>> response = client.analyze_entity_sentiment(document)
242239
243240 Args:
244241 document (:class:`google.cloud.proto.language.v1beta2.language_service_pb2.Document`): Input document.
@@ -253,25 +250,22 @@ def analyze_entity_sentiment(self, document, encoding_type, options=None):
253250 :exc:`google.gax.errors.GaxError` if the RPC is aborted.
254251 :exc:`ValueError` if the parameters are invalid.
255252 """
256- # Create the request object.
257253 request = language_service_pb2 .AnalyzeEntitySentimentRequest (
258254 document = document , encoding_type = encoding_type )
259255 return self ._analyze_entity_sentiment (request , options )
260256
261- def analyze_syntax (self , document , encoding_type , options = None ):
257+ def analyze_syntax (self , document , encoding_type = None , options = None ):
262258 """
263259 Analyzes the syntax of the text and provides sentence boundaries and
264260 tokenization along with part of speech tags, dependency trees, and other
265261 properties.
266262
267263 Example:
268264 >>> from google.cloud.gapic.language.v1beta2 import language_service_client
269- >>> from google.cloud.gapic.language.v1beta2 import enums
270265 >>> from google.cloud.proto.language.v1beta2 import language_service_pb2
271266 >>> client = language_service_client.LanguageServiceClient()
272267 >>> document = language_service_pb2.Document()
273- >>> encoding_type = enums.EncodingType.NONE
274- >>> response = client.analyze_syntax(document, encoding_type)
268+ >>> response = client.analyze_syntax(document)
275269
276270 Args:
277271 document (:class:`google.cloud.proto.language.v1beta2.language_service_pb2.Document`): Input document.
@@ -286,25 +280,26 @@ def analyze_syntax(self, document, encoding_type, options=None):
286280 :exc:`google.gax.errors.GaxError` if the RPC is aborted.
287281 :exc:`ValueError` if the parameters are invalid.
288282 """
289- # Create the request object.
290283 request = language_service_pb2 .AnalyzeSyntaxRequest (
291284 document = document , encoding_type = encoding_type )
292285 return self ._analyze_syntax (request , options )
293286
294- def annotate_text (self , document , features , encoding_type , options = None ):
287+ def annotate_text (self ,
288+ document ,
289+ features ,
290+ encoding_type = None ,
291+ options = None ):
295292 """
296293 A convenience method that provides all syntax, sentiment, and entity
297294 features in one call.
298295
299296 Example:
300297 >>> from google.cloud.gapic.language.v1beta2 import language_service_client
301- >>> from google.cloud.gapic.language.v1beta2 import enums
302298 >>> from google.cloud.proto.language.v1beta2 import language_service_pb2
303299 >>> client = language_service_client.LanguageServiceClient()
304300 >>> document = language_service_pb2.Document()
305301 >>> features = language_service_pb2.AnnotateTextRequest.Features()
306- >>> encoding_type = enums.EncodingType.NONE
307- >>> response = client.annotate_text(document, features, encoding_type)
302+ >>> response = client.annotate_text(document, features)
308303
309304 Args:
310305 document (:class:`google.cloud.proto.language.v1beta2.language_service_pb2.Document`): Input document.
@@ -320,7 +315,6 @@ def annotate_text(self, document, features, encoding_type, options=None):
320315 :exc:`google.gax.errors.GaxError` if the RPC is aborted.
321316 :exc:`ValueError` if the parameters are invalid.
322317 """
323- # Create the request object.
324318 request = language_service_pb2 .AnnotateTextRequest (
325319 document = document , features = features , encoding_type = encoding_type )
326320 return self ._annotate_text (request , options )
0 commit comments