@@ -113,7 +113,7 @@ def serialize(self, options):
113113 """serialize keys with values"""
114114 self .validate ()
115115 values = {}
116- for ( key , val ) in self .__params .items ():
116+ for key , val in self .__params .items ():
117117 if val is None :
118118 continue
119119 else :
@@ -212,7 +212,7 @@ class NameTranslationParameters(_DocumentParamSetBase):
212212
213213 C{targetLangauge} The language into which the name is to be translated.
214214
215- C{entityType} The entity type (TBD) of the name.
215+ C{entityType} The entity type of the name. PERSON (default), LOCATION, or ORGANIZATION
216216
217217 C{sourceLanguageOfOrigin} The language of origin of the name.
218218
@@ -240,7 +240,7 @@ def __init__(self):
240240
241241 def validate (self ):
242242 """Internal. Do not use."""
243- for option in ( "name" , "targetLanguage" ) : # required
243+ for option in "name" , "targetLanguage" : # required
244244 if self [option ] is None :
245245 raise RosetteException (
246246 "missingParameter" ,
@@ -250,23 +250,32 @@ def validate(self):
250250
251251class AddressSimilarityParameters (_DocumentParamSetBase ):
252252 """Parameter object for C{address-similarity} endpoint.
253- All are required.
253+
254+ C{address1} and C{address2} are required.
255+
256+ `parameters` is optional.
254257
255258 C{address1} The address to be matched, a C{address} object or address string.
256259
257260 C{address2} The address to be matched, a C{address} object or address string.
258261
259262 The C{address} object contains these optional fields:
260263 city, island, district, stateDistrict, state, countryRegion, country, worldRegion, postCode, poBox
264+
265+ `parameters` is a dictionary listing any parameter overrides to include. For example, `postCodeAddressFieldWeight`.
266+ Setting `parameters` is not cumulative. Define all overrides at once. If defined multiple times, only the
267+ final declaration is used.
268+
269+ See `examples/address_similarity.py`
261270 """
262271
263272 def __init__ (self ):
264273 self .use_multipart = False
265- _DocumentParamSetBase .__init__ (self , ("address1" , "address2" ))
274+ _DocumentParamSetBase .__init__ (self , ("address1" , "address2" , "parameters" ))
266275
267276 def validate (self ):
268277 """Internal. Do not use."""
269- for option in ( "address1" , "address2" ) : # required
278+ for option in "address1" , "address2" : # required
270279 if self [option ] is None :
271280 raise RosetteException (
272281 "missingParameter" ,
@@ -276,30 +285,39 @@ def validate(self):
276285
277286class NameSimilarityParameters (_DocumentParamSetBase ):
278287 """Parameter object for C{name-similarity} endpoint.
279- All are required.
288+
289+ C{name1} and C{name2} are required.
290+
291+ `parameters` is optional.
280292
281293 C{name1} The name to be matched, a C{name} object.
282294
283295 C{name2} The name to be matched, a C{name} object.
284296
285297 The C{name} object contains these fields:
286298
287- C{text} Text of the name, required.
299+ C{text} Text of the name, required.
300+
301+ C{language} Language of the name in ISO639 three-letter code, optional.
302+
303+ C{script} The ISO15924 code of the name, optional.
288304
289- C{language} Language of the name in ISO639 three-letter code , optional.
305+ C{entityType} The entity type, can be "PERSON", "LOCATION" or "ORGANIZATION" , optional.
290306
291- C{script} The ISO15924 code of the name, optional.
307+ `parameters` is a dictionary listing any parameter overrides to include. For example, `deletionScore`.
308+ Setting `parameters` is not cumulative. Define all overrides at once. If defined multiple times, only the
309+ final declaration is used.
292310
293- C{entityType} The entity type, can be "PERSON", "LOCATION" or "ORGANIZATION", optional.
311+ See `examples/name_similarity.py`
294312 """
295313
296314 def __init__ (self ):
297315 self .use_multipart = False
298- _DocumentParamSetBase .__init__ (self , ("name1" , "name2" ))
316+ _DocumentParamSetBase .__init__ (self , ("name1" , "name2" , "parameters" ))
299317
300318 def validate (self ):
301319 """Internal. Do not use."""
302- for option in ( "name1" , "name2" ) : # required
320+ for option in "name1" , "name2" : # required
303321 if self [option ] is None :
304322 raise RosetteException (
305323 "missingParameter" ,
0 commit comments