Skip to content

Commit c995a50

Browse files
yoshi-automationbusunkim96
authored andcommitted
Add google.api proto annotations, update docstrings (via synth). (#7659)
Adds annotations for google.api.client and google.api.field_behavior to Cloud Natural Language API.
1 parent 23ba642 commit c995a50

5 files changed

Lines changed: 255 additions & 171 deletions

File tree

language/google/cloud/language_v1/gapic/enums.py

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,22 +241,54 @@ class Type(enum.IntEnum):
241241
class Entity(object):
242242
class Type(enum.IntEnum):
243243
"""
244-
The type of the entity.
244+
The type of the entity. For most entity types, the associated metadata
245+
is a Wikipedia URL (``wikipedia_url``) and Knowledge Graph MID
246+
(``mid``). The table below lists the associated fields for entities that
247+
have different metadata.
245248
246249
Attributes:
247250
UNKNOWN (int): Unknown
248251
PERSON (int): Person
249252
LOCATION (int): Location
250253
ORGANIZATION (int): Organization
251254
EVENT (int): Event
252-
WORK_OF_ART (int): Work of art
253-
CONSUMER_GOOD (int): Consumer goods
254-
OTHER (int): Other types
255-
PHONE_NUMBER (int): Phone number
256-
ADDRESS (int): Address
257-
DATE (int): Date
258-
NUMBER (int): Number
259-
PRICE (int): Price
255+
WORK_OF_ART (int): Artwork
256+
CONSUMER_GOOD (int): Consumer product
257+
OTHER (int): Other types of entities
258+
PHONE_NUMBER (int): Phone number The metadata lists the phone number, formatted according to
259+
local convention, plus whichever additional elements appear in the text:
260+
261+
.. raw:: html
262+
263+
<li><code>number</code> &ndash; the actual number, broken down into
264+
sections as per local convention</li> <li><code>national_prefix</code>
265+
&ndash; country code, if detected</li> <li><code>area_code</code> &ndash;
266+
region or area code, if detected</li> <li><code>extension</code> &ndash;
267+
phone extension (to be dialed after connection), if detected</li></ul>
268+
ADDRESS (int): Address The metadata identifies the street number and locality plus
269+
whichever additional elements appear in the text:
270+
271+
.. raw:: html
272+
273+
<li><code>street_number</code> &ndash; street number</li>
274+
<li><code>locality</code> &ndash; city or town</li>
275+
<li><code>street_name</code> &ndash; street/route name, if detected</li>
276+
<li><code>postal_code</code> &ndash; postal code, if detected</li>
277+
<li><code>country</code> &ndash; country, if detected</li>
278+
<li><code>broad_region</code> &ndash; administrative area, such as the
279+
state, if detected</li> <li><code>narrow_region</code> &ndash; smaller
280+
administrative area, such as county, if detected</li>
281+
<li><code>sublocality</code> &ndash; used in Asian addresses to demark a
282+
district within a city, if detected</li></ul>
283+
DATE (int): Date<br><br>
284+
The metadata identifies the components of the date:<ul>
285+
<li><code>year</code> &ndash; four digit year, if detected</li>
286+
<li><code>month</code> &ndash; two digit month number, if detected</li>
287+
<li><code>day</code> &ndash; two digit day number, if detected</li></ul>
288+
NUMBER (int): Number<br><br>
289+
The metadata is the number itself.
290+
PRICE (int): Price<br><br>
291+
The metadata identifies the <code>value</code> and <code>currency</code>.
260292
"""
261293

262294
UNKNOWN = 0

0 commit comments

Comments
 (0)