public static enum Entity.Type extends Enum<Entity.Type> implements com.google.protobuf.ProtocolMessageEnum
The type of the entity. For most entity types, the associated metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table below lists the associated fields for entities that have different metadata.Protobuf enum
google.cloud.language.v1.Entity.Type| Enum Constant and Description |
|---|
ADDRESS
Address<br><br>
The metadata identifies the street number and locality plus whichever
additional elements appear in the text:<ul>
<li><code>street_number</code> – street number</li>
<li><code>locality</code> – city or town</li>
<li><code>street_name</code> – street/route name, if detected</li>
<li><code>postal_code</code> – postal code, if detected</li>
<li><code>country</code> – country, if detected</li>
<li><code>broad_region</code> – administrative area, such as the
state, if detected</li> <li><code>narrow_region</code> – smaller
administrative area, such as county, if detected</li>
<li><code>sublocality</code> – used in Asian addresses to demark a
district within a city, if detected</li></ul>
|
CONSUMER_GOOD
Consumer product
|
DATE
Date<br><br>
The metadata identifies the components of the date:<ul>
<li><code>year</code> – four digit year, if detected</li>
<li><code>month</code> – two digit month number, if detected</li>
<li><code>day</code> – two digit day number, if detected</li></ul>
|
EVENT
Event
|
LOCATION
Location
|
NUMBER
Number<br><br>
The metadata is the number itself.
|
ORGANIZATION
Organization
|
OTHER
Other types of entities
|
PERSON
Person
|
PHONE_NUMBER
Phone number<br><br>
The metadata lists the phone number, formatted according to local
convention, plus whichever additional elements appear in the text:<ul>
<li><code>number</code> – the actual number, broken down into
sections as per local convention</li> <li><code>national_prefix</code>
– country code, if detected</li> <li><code>area_code</code> –
region or area code, if detected</li> <li><code>extension</code> –
phone extension (to be dialed after connection), if detected</li></ul>
|
PRICE
Price<br><br>
The metadata identifies the <code>value</code> and <code>currency</code>.
|
UNKNOWN
Unknown
|
UNRECOGNIZED |
WORK_OF_ART
Artwork
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ADDRESS_VALUE
Address<br><br>
The metadata identifies the street number and locality plus whichever
additional elements appear in the text:<ul>
<li><code>street_number</code> – street number</li>
<li><code>locality</code> – city or town</li>
<li><code>street_name</code> – street/route name, if detected</li>
<li><code>postal_code</code> – postal code, if detected</li>
<li><code>country</code> – country, if detected</li>
<li><code>broad_region</code> – administrative area, such as the
state, if detected</li> <li><code>narrow_region</code> – smaller
administrative area, such as county, if detected</li>
<li><code>sublocality</code> – used in Asian addresses to demark a
district within a city, if detected</li></ul>
|
static int |
CONSUMER_GOOD_VALUE
Consumer product
|
static int |
DATE_VALUE
Date<br><br>
The metadata identifies the components of the date:<ul>
<li><code>year</code> – four digit year, if detected</li>
<li><code>month</code> – two digit month number, if detected</li>
<li><code>day</code> – two digit day number, if detected</li></ul>
|
static int |
EVENT_VALUE
Event
|
static int |
LOCATION_VALUE
Location
|
static int |
NUMBER_VALUE
Number<br><br>
The metadata is the number itself.
|
static int |
ORGANIZATION_VALUE
Organization
|
static int |
OTHER_VALUE
Other types of entities
|
static int |
PERSON_VALUE
Person
|
static int |
PHONE_NUMBER_VALUE
Phone number<br><br>
The metadata lists the phone number, formatted according to local
convention, plus whichever additional elements appear in the text:<ul>
<li><code>number</code> – the actual number, broken down into
sections as per local convention</li> <li><code>national_prefix</code>
– country code, if detected</li> <li><code>area_code</code> –
region or area code, if detected</li> <li><code>extension</code> –
phone extension (to be dialed after connection), if detected</li></ul>
|
static int |
PRICE_VALUE
Price<br><br>
The metadata identifies the <code>value</code> and <code>currency</code>.
|
static int |
UNKNOWN_VALUE
Unknown
|
static int |
WORK_OF_ART_VALUE
Artwork
|
| Modifier and Type | Method and Description |
|---|---|
static Entity.Type |
forNumber(int value) |
static com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptor() |
com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptorForType() |
int |
getNumber() |
com.google.protobuf.Descriptors.EnumValueDescriptor |
getValueDescriptor() |
static com.google.protobuf.Internal.EnumLiteMap<Entity.Type> |
internalGetValueMap() |
static Entity.Type |
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) |
static Entity.Type |
valueOf(int value)
Deprecated.
Use
forNumber(int) instead. |
static Entity.Type |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Entity.Type[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Entity.Type UNKNOWN
Unknown
UNKNOWN = 0;public static final Entity.Type PERSON
Person
PERSON = 1;public static final Entity.Type LOCATION
Location
LOCATION = 2;public static final Entity.Type ORGANIZATION
Organization
ORGANIZATION = 3;public static final Entity.Type EVENT
Event
EVENT = 4;public static final Entity.Type WORK_OF_ART
Artwork
WORK_OF_ART = 5;public static final Entity.Type CONSUMER_GOOD
Consumer product
CONSUMER_GOOD = 6;public static final Entity.Type OTHER
Other types of entities
OTHER = 7;public static final Entity.Type PHONE_NUMBER
Phone number<br><br> The metadata lists the phone number, formatted according to local convention, plus whichever additional elements appear in the text:<ul> <li><code>number</code> – the actual number, broken down into sections as per local convention</li> <li><code>national_prefix</code> – country code, if detected</li> <li><code>area_code</code> – region or area code, if detected</li> <li><code>extension</code> – phone extension (to be dialed after connection), if detected</li></ul>
PHONE_NUMBER = 9;public static final Entity.Type ADDRESS
Address<br><br> The metadata identifies the street number and locality plus whichever additional elements appear in the text:<ul> <li><code>street_number</code> – street number</li> <li><code>locality</code> – city or town</li> <li><code>street_name</code> – street/route name, if detected</li> <li><code>postal_code</code> – postal code, if detected</li> <li><code>country</code> – country, if detected</li> <li><code>broad_region</code> – administrative area, such as the state, if detected</li> <li><code>narrow_region</code> – smaller administrative area, such as county, if detected</li> <li><code>sublocality</code> – used in Asian addresses to demark a district within a city, if detected</li></ul>
ADDRESS = 10;public static final Entity.Type DATE
Date<br><br> The metadata identifies the components of the date:<ul> <li><code>year</code> – four digit year, if detected</li> <li><code>month</code> – two digit month number, if detected</li> <li><code>day</code> – two digit day number, if detected</li></ul>
DATE = 11;public static final Entity.Type NUMBER
Number<br><br> The metadata is the number itself.
NUMBER = 12;public static final Entity.Type PRICE
Price<br><br> The metadata identifies the <code>value</code> and <code>currency</code>.
PRICE = 13;public static final Entity.Type UNRECOGNIZED
public static final int UNKNOWN_VALUE
Unknown
UNKNOWN = 0;public static final int PERSON_VALUE
Person
PERSON = 1;public static final int LOCATION_VALUE
Location
LOCATION = 2;public static final int ORGANIZATION_VALUE
Organization
ORGANIZATION = 3;public static final int EVENT_VALUE
Event
EVENT = 4;public static final int WORK_OF_ART_VALUE
Artwork
WORK_OF_ART = 5;public static final int CONSUMER_GOOD_VALUE
Consumer product
CONSUMER_GOOD = 6;public static final int OTHER_VALUE
Other types of entities
OTHER = 7;public static final int PHONE_NUMBER_VALUE
Phone number<br><br> The metadata lists the phone number, formatted according to local convention, plus whichever additional elements appear in the text:<ul> <li><code>number</code> – the actual number, broken down into sections as per local convention</li> <li><code>national_prefix</code> – country code, if detected</li> <li><code>area_code</code> – region or area code, if detected</li> <li><code>extension</code> – phone extension (to be dialed after connection), if detected</li></ul>
PHONE_NUMBER = 9;public static final int ADDRESS_VALUE
Address<br><br> The metadata identifies the street number and locality plus whichever additional elements appear in the text:<ul> <li><code>street_number</code> – street number</li> <li><code>locality</code> – city or town</li> <li><code>street_name</code> – street/route name, if detected</li> <li><code>postal_code</code> – postal code, if detected</li> <li><code>country</code> – country, if detected</li> <li><code>broad_region</code> – administrative area, such as the state, if detected</li> <li><code>narrow_region</code> – smaller administrative area, such as county, if detected</li> <li><code>sublocality</code> – used in Asian addresses to demark a district within a city, if detected</li></ul>
ADDRESS = 10;public static final int DATE_VALUE
Date<br><br> The metadata identifies the components of the date:<ul> <li><code>year</code> – four digit year, if detected</li> <li><code>month</code> – two digit month number, if detected</li> <li><code>day</code> – two digit day number, if detected</li></ul>
DATE = 11;public static final int NUMBER_VALUE
Number<br><br> The metadata is the number itself.
NUMBER = 12;public static final int PRICE_VALUE
Price<br><br> The metadata identifies the <code>value</code> and <code>currency</code>.
PRICE = 13;public static Entity.Type[] values()
for (Entity.Type c : Entity.Type.values()) System.out.println(c);
public static Entity.Type valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic final int getNumber()
getNumber in interface com.google.protobuf.Internal.EnumLitegetNumber in interface com.google.protobuf.ProtocolMessageEnum@Deprecated public static Entity.Type valueOf(int value)
forNumber(int) instead.public static Entity.Type forNumber(int value)
public static com.google.protobuf.Internal.EnumLiteMap<Entity.Type> internalGetValueMap()
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
getValueDescriptor in interface com.google.protobuf.ProtocolMessageEnumpublic final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.ProtocolMessageEnumpublic static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
public static Entity.Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Copyright © 2019 Google LLC. All rights reserved.