com.google.cloud.language.v1.PartOfSpeech Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-google-cloud-language-v1 Show documentation
Show all versions of grpc-google-cloud-language-v1 Show documentation
GRPC library for grpc-google-cloud-language-v1
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/language/v1/language_service.proto
package com.google.cloud.language.v1;
/**
*
* Represents part of speech information for a token. Parts of speech
* are as defined in
* http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
*
*
* Protobuf type {@code google.cloud.language.v1.PartOfSpeech}
*/
public final class PartOfSpeech extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.cloud.language.v1.PartOfSpeech)
PartOfSpeechOrBuilder {
// Use PartOfSpeech.newBuilder() to construct.
private PartOfSpeech(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private PartOfSpeech() {
tag_ = 0;
aspect_ = 0;
case_ = 0;
form_ = 0;
gender_ = 0;
mood_ = 0;
number_ = 0;
person_ = 0;
proper_ = 0;
reciprocity_ = 0;
tense_ = 0;
voice_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private PartOfSpeech(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
int rawValue = input.readEnum();
tag_ = rawValue;
break;
}
case 16: {
int rawValue = input.readEnum();
aspect_ = rawValue;
break;
}
case 24: {
int rawValue = input.readEnum();
case_ = rawValue;
break;
}
case 32: {
int rawValue = input.readEnum();
form_ = rawValue;
break;
}
case 40: {
int rawValue = input.readEnum();
gender_ = rawValue;
break;
}
case 48: {
int rawValue = input.readEnum();
mood_ = rawValue;
break;
}
case 56: {
int rawValue = input.readEnum();
number_ = rawValue;
break;
}
case 64: {
int rawValue = input.readEnum();
person_ = rawValue;
break;
}
case 72: {
int rawValue = input.readEnum();
proper_ = rawValue;
break;
}
case 80: {
int rawValue = input.readEnum();
reciprocity_ = rawValue;
break;
}
case 88: {
int rawValue = input.readEnum();
tense_ = rawValue;
break;
}
case 96: {
int rawValue = input.readEnum();
voice_ = rawValue;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.cloud.language.v1.LanguageServiceProto.internal_static_google_cloud_language_v1_PartOfSpeech_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.language.v1.LanguageServiceProto.internal_static_google_cloud_language_v1_PartOfSpeech_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.language.v1.PartOfSpeech.class, com.google.cloud.language.v1.PartOfSpeech.Builder.class);
}
/**
*
* The part of speech tags enum.
*
*
* Protobuf enum {@code google.cloud.language.v1.PartOfSpeech.Tag}
*/
public enum Tag
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Unknown
*
*
* UNKNOWN = 0;
*/
UNKNOWN(0),
/**
*
* Adjective
*
*
* ADJ = 1;
*/
ADJ(1),
/**
*
* Adposition (preposition and postposition)
*
*
* ADP = 2;
*/
ADP(2),
/**
*
* Adverb
*
*
* ADV = 3;
*/
ADV(3),
/**
*
* Conjunction
*
*
* CONJ = 4;
*/
CONJ(4),
/**
*
* Determiner
*
*
* DET = 5;
*/
DET(5),
/**
*
* Noun (common and proper)
*
*
* NOUN = 6;
*/
NOUN(6),
/**
*
* Cardinal number
*
*
* NUM = 7;
*/
NUM(7),
/**
*
* Pronoun
*
*
* PRON = 8;
*/
PRON(8),
/**
*
* Particle or other function word
*
*
* PRT = 9;
*/
PRT(9),
/**
*
* Punctuation
*
*
* PUNCT = 10;
*/
PUNCT(10),
/**
*
* Verb (all tenses and modes)
*
*
* VERB = 11;
*/
VERB(11),
/**
*
* Other: foreign words, typos, abbreviations
*
*
* X = 12;
*/
X(12),
/**
*
* Affix
*
*
* AFFIX = 13;
*/
AFFIX(13),
UNRECOGNIZED(-1),
;
/**
*
* Unknown
*
*
* UNKNOWN = 0;
*/
public static final int UNKNOWN_VALUE = 0;
/**
*
* Adjective
*
*
* ADJ = 1;
*/
public static final int ADJ_VALUE = 1;
/**
*
* Adposition (preposition and postposition)
*
*
* ADP = 2;
*/
public static final int ADP_VALUE = 2;
/**
*
* Adverb
*
*
* ADV = 3;
*/
public static final int ADV_VALUE = 3;
/**
*
* Conjunction
*
*
* CONJ = 4;
*/
public static final int CONJ_VALUE = 4;
/**
*
* Determiner
*
*
* DET = 5;
*/
public static final int DET_VALUE = 5;
/**
*
* Noun (common and proper)
*
*
* NOUN = 6;
*/
public static final int NOUN_VALUE = 6;
/**
*
* Cardinal number
*
*
* NUM = 7;
*/
public static final int NUM_VALUE = 7;
/**
*
* Pronoun
*
*
* PRON = 8;
*/
public static final int PRON_VALUE = 8;
/**
*
* Particle or other function word
*
*
* PRT = 9;
*/
public static final int PRT_VALUE = 9;
/**
*
* Punctuation
*
*
* PUNCT = 10;
*/
public static final int PUNCT_VALUE = 10;
/**
*
* Verb (all tenses and modes)
*
*
* VERB = 11;
*/
public static final int VERB_VALUE = 11;
/**
*
* Other: foreign words, typos, abbreviations
*
*
* X = 12;
*/
public static final int X_VALUE = 12;
/**
*
* Affix
*
*
* AFFIX = 13;
*/
public static final int AFFIX_VALUE = 13;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Tag valueOf(int value) {
return forNumber(value);
}
public static Tag forNumber(int value) {
switch (value) {
case 0: return UNKNOWN;
case 1: return ADJ;
case 2: return ADP;
case 3: return ADV;
case 4: return CONJ;
case 5: return DET;
case 6: return NOUN;
case 7: return NUM;
case 8: return PRON;
case 9: return PRT;
case 10: return PUNCT;
case 11: return VERB;
case 12: return X;
case 13: return AFFIX;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Tag> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Tag findValueByNumber(int number) {
return Tag.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.cloud.language.v1.PartOfSpeech.getDescriptor().getEnumTypes().get(0);
}
private static final Tag[] VALUES = values();
public static Tag valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Tag(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.language.v1.PartOfSpeech.Tag)
}
/**
*
* The characteristic of a verb that expresses time flow during an event.
*
*
* Protobuf enum {@code google.cloud.language.v1.PartOfSpeech.Aspect}
*/
public enum Aspect
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Aspect is not applicable in the analyzed language or is not predicted.
*
*
* ASPECT_UNKNOWN = 0;
*/
ASPECT_UNKNOWN(0),
/**
*
* Perfective
*
*
* PERFECTIVE = 1;
*/
PERFECTIVE(1),
/**
*
* Imperfective
*
*
* IMPERFECTIVE = 2;
*/
IMPERFECTIVE(2),
/**
*
* Progressive
*
*
* PROGRESSIVE = 3;
*/
PROGRESSIVE(3),
UNRECOGNIZED(-1),
;
/**
*
* Aspect is not applicable in the analyzed language or is not predicted.
*
*
* ASPECT_UNKNOWN = 0;
*/
public static final int ASPECT_UNKNOWN_VALUE = 0;
/**
*
* Perfective
*
*
* PERFECTIVE = 1;
*/
public static final int PERFECTIVE_VALUE = 1;
/**
*
* Imperfective
*
*
* IMPERFECTIVE = 2;
*/
public static final int IMPERFECTIVE_VALUE = 2;
/**
*
* Progressive
*
*
* PROGRESSIVE = 3;
*/
public static final int PROGRESSIVE_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Aspect valueOf(int value) {
return forNumber(value);
}
public static Aspect forNumber(int value) {
switch (value) {
case 0: return ASPECT_UNKNOWN;
case 1: return PERFECTIVE;
case 2: return IMPERFECTIVE;
case 3: return PROGRESSIVE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Aspect> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Aspect findValueByNumber(int number) {
return Aspect.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.cloud.language.v1.PartOfSpeech.getDescriptor().getEnumTypes().get(1);
}
private static final Aspect[] VALUES = values();
public static Aspect valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Aspect(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.language.v1.PartOfSpeech.Aspect)
}
/**
*
* The grammatical function performed by a noun or pronoun in a phrase,
* clause, or sentence. In some languages, other parts of speech, such as
* adjective and determiner, take case inflection in agreement with the noun.
*
*
* Protobuf enum {@code google.cloud.language.v1.PartOfSpeech.Case}
*/
public enum Case
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Case is not applicable in the analyzed language or is not predicted.
*
*
* CASE_UNKNOWN = 0;
*/
CASE_UNKNOWN(0),
/**
*
* Accusative
*
*
* ACCUSATIVE = 1;
*/
ACCUSATIVE(1),
/**
*
* Adverbial
*
*
* ADVERBIAL = 2;
*/
ADVERBIAL(2),
/**
*
* Complementive
*
*
* COMPLEMENTIVE = 3;
*/
COMPLEMENTIVE(3),
/**
*
* Dative
*
*
* DATIVE = 4;
*/
DATIVE(4),
/**
*
* Genitive
*
*
* GENITIVE = 5;
*/
GENITIVE(5),
/**
*
* Instrumental
*
*
* INSTRUMENTAL = 6;
*/
INSTRUMENTAL(6),
/**
*
* Locative
*
*
* LOCATIVE = 7;
*/
LOCATIVE(7),
/**
*
* Nominative
*
*
* NOMINATIVE = 8;
*/
NOMINATIVE(8),
/**
*
* Oblique
*
*
* OBLIQUE = 9;
*/
OBLIQUE(9),
/**
*
* Partitive
*
*
* PARTITIVE = 10;
*/
PARTITIVE(10),
/**
*
* Prepositional
*
*
* PREPOSITIONAL = 11;
*/
PREPOSITIONAL(11),
/**
*
* Reflexive
*
*
* REFLEXIVE_CASE = 12;
*/
REFLEXIVE_CASE(12),
/**
*
* Relative
*
*
* RELATIVE_CASE = 13;
*/
RELATIVE_CASE(13),
/**
*
* Vocative
*
*
* VOCATIVE = 14;
*/
VOCATIVE(14),
UNRECOGNIZED(-1),
;
/**
*
* Case is not applicable in the analyzed language or is not predicted.
*
*
* CASE_UNKNOWN = 0;
*/
public static final int CASE_UNKNOWN_VALUE = 0;
/**
*
* Accusative
*
*
* ACCUSATIVE = 1;
*/
public static final int ACCUSATIVE_VALUE = 1;
/**
*
* Adverbial
*
*
* ADVERBIAL = 2;
*/
public static final int ADVERBIAL_VALUE = 2;
/**
*
* Complementive
*
*
* COMPLEMENTIVE = 3;
*/
public static final int COMPLEMENTIVE_VALUE = 3;
/**
*
* Dative
*
*
* DATIVE = 4;
*/
public static final int DATIVE_VALUE = 4;
/**
*
* Genitive
*
*
* GENITIVE = 5;
*/
public static final int GENITIVE_VALUE = 5;
/**
*
* Instrumental
*
*
* INSTRUMENTAL = 6;
*/
public static final int INSTRUMENTAL_VALUE = 6;
/**
*
* Locative
*
*
* LOCATIVE = 7;
*/
public static final int LOCATIVE_VALUE = 7;
/**
*
* Nominative
*
*
* NOMINATIVE = 8;
*/
public static final int NOMINATIVE_VALUE = 8;
/**
*
* Oblique
*
*
* OBLIQUE = 9;
*/
public static final int OBLIQUE_VALUE = 9;
/**
*
* Partitive
*
*
* PARTITIVE = 10;
*/
public static final int PARTITIVE_VALUE = 10;
/**
*
* Prepositional
*
*
* PREPOSITIONAL = 11;
*/
public static final int PREPOSITIONAL_VALUE = 11;
/**
*
* Reflexive
*
*
* REFLEXIVE_CASE = 12;
*/
public static final int REFLEXIVE_CASE_VALUE = 12;
/**
*
* Relative
*
*
* RELATIVE_CASE = 13;
*/
public static final int RELATIVE_CASE_VALUE = 13;
/**
*
* Vocative
*
*
* VOCATIVE = 14;
*/
public static final int VOCATIVE_VALUE = 14;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Case valueOf(int value) {
return forNumber(value);
}
public static Case forNumber(int value) {
switch (value) {
case 0: return CASE_UNKNOWN;
case 1: return ACCUSATIVE;
case 2: return ADVERBIAL;
case 3: return COMPLEMENTIVE;
case 4: return DATIVE;
case 5: return GENITIVE;
case 6: return INSTRUMENTAL;
case 7: return LOCATIVE;
case 8: return NOMINATIVE;
case 9: return OBLIQUE;
case 10: return PARTITIVE;
case 11: return PREPOSITIONAL;
case 12: return REFLEXIVE_CASE;
case 13: return RELATIVE_CASE;
case 14: return VOCATIVE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Case> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Case findValueByNumber(int number) {
return Case.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.cloud.language.v1.PartOfSpeech.getDescriptor().getEnumTypes().get(2);
}
private static final Case[] VALUES = values();
public static Case valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Case(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.language.v1.PartOfSpeech.Case)
}
/**
*
* Depending on the language, Form can be categorizing different forms of
* verbs, adjectives, adverbs, etc. For example, categorizing inflected
* endings of verbs and adjectives or distinguishing between short and long
* forms of adjectives and participles
*
*
* Protobuf enum {@code google.cloud.language.v1.PartOfSpeech.Form}
*/
public enum Form
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Form is not applicable in the analyzed language or is not predicted.
*
*
* FORM_UNKNOWN = 0;
*/
FORM_UNKNOWN(0),
/**
*
* Adnomial
*
*
* ADNOMIAL = 1;
*/
ADNOMIAL(1),
/**
*
* Auxiliary
*
*
* AUXILIARY = 2;
*/
AUXILIARY(2),
/**
*
* Complementizer
*
*
* COMPLEMENTIZER = 3;
*/
COMPLEMENTIZER(3),
/**
*
* Final ending
*
*
* FINAL_ENDING = 4;
*/
FINAL_ENDING(4),
/**
*
* Gerund
*
*
* GERUND = 5;
*/
GERUND(5),
/**
*
* Realis
*
*
* REALIS = 6;
*/
REALIS(6),
/**
*
* Irrealis
*
*
* IRREALIS = 7;
*/
IRREALIS(7),
/**
*
* Short form
*
*
* SHORT = 8;
*/
SHORT(8),
/**
*
* Long form
*
*
* LONG = 9;
*/
LONG(9),
/**
*
* Order form
*
*
* ORDER = 10;
*/
ORDER(10),
/**
*
* Specific form
*
*
* SPECIFIC = 11;
*/
SPECIFIC(11),
UNRECOGNIZED(-1),
;
/**
*
* Form is not applicable in the analyzed language or is not predicted.
*
*
* FORM_UNKNOWN = 0;
*/
public static final int FORM_UNKNOWN_VALUE = 0;
/**
*
* Adnomial
*
*
* ADNOMIAL = 1;
*/
public static final int ADNOMIAL_VALUE = 1;
/**
*
* Auxiliary
*
*
* AUXILIARY = 2;
*/
public static final int AUXILIARY_VALUE = 2;
/**
*
* Complementizer
*
*
* COMPLEMENTIZER = 3;
*/
public static final int COMPLEMENTIZER_VALUE = 3;
/**
*
* Final ending
*
*
* FINAL_ENDING = 4;
*/
public static final int FINAL_ENDING_VALUE = 4;
/**
*
* Gerund
*
*
* GERUND = 5;
*/
public static final int GERUND_VALUE = 5;
/**
*
* Realis
*
*
* REALIS = 6;
*/
public static final int REALIS_VALUE = 6;
/**
*
* Irrealis
*
*
* IRREALIS = 7;
*/
public static final int IRREALIS_VALUE = 7;
/**
*
* Short form
*
*
* SHORT = 8;
*/
public static final int SHORT_VALUE = 8;
/**
*
* Long form
*
*
* LONG = 9;
*/
public static final int LONG_VALUE = 9;
/**
*
* Order form
*
*
* ORDER = 10;
*/
public static final int ORDER_VALUE = 10;
/**
*
* Specific form
*
*
* SPECIFIC = 11;
*/
public static final int SPECIFIC_VALUE = 11;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Form valueOf(int value) {
return forNumber(value);
}
public static Form forNumber(int value) {
switch (value) {
case 0: return FORM_UNKNOWN;
case 1: return ADNOMIAL;
case 2: return AUXILIARY;
case 3: return COMPLEMENTIZER;
case 4: return FINAL_ENDING;
case 5: return GERUND;
case 6: return REALIS;
case 7: return IRREALIS;
case 8: return SHORT;
case 9: return LONG;
case 10: return ORDER;
case 11: return SPECIFIC;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap