1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/language/v1/language_service.proto 18 19 package com.google.cloud.language.v1; 20 21 public interface EntityOrBuilder 22 extends 23 // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.Entity) 24 com.google.protobuf.MessageOrBuilder { 25 26 /** 27 * 28 * 29 * <pre> 30 * The representative name for the entity. 31 * </pre> 32 * 33 * <code>string name = 1;</code> 34 * 35 * @return The name. 36 */ getName()37 java.lang.String getName(); 38 /** 39 * 40 * 41 * <pre> 42 * The representative name for the entity. 43 * </pre> 44 * 45 * <code>string name = 1;</code> 46 * 47 * @return The bytes for name. 48 */ getNameBytes()49 com.google.protobuf.ByteString getNameBytes(); 50 51 /** 52 * 53 * 54 * <pre> 55 * The entity type. 56 * </pre> 57 * 58 * <code>.google.cloud.language.v1.Entity.Type type = 2;</code> 59 * 60 * @return The enum numeric value on the wire for type. 61 */ getTypeValue()62 int getTypeValue(); 63 /** 64 * 65 * 66 * <pre> 67 * The entity type. 68 * </pre> 69 * 70 * <code>.google.cloud.language.v1.Entity.Type type = 2;</code> 71 * 72 * @return The type. 73 */ getType()74 com.google.cloud.language.v1.Entity.Type getType(); 75 76 /** 77 * 78 * 79 * <pre> 80 * Metadata associated with the entity. 81 * For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) 82 * and Knowledge Graph MID (`mid`), if they are available. For the metadata 83 * associated with other entity types, see the Type table below. 84 * </pre> 85 * 86 * <code>map<string, string> metadata = 3;</code> 87 */ getMetadataCount()88 int getMetadataCount(); 89 /** 90 * 91 * 92 * <pre> 93 * Metadata associated with the entity. 94 * For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) 95 * and Knowledge Graph MID (`mid`), if they are available. For the metadata 96 * associated with other entity types, see the Type table below. 97 * </pre> 98 * 99 * <code>map<string, string> metadata = 3;</code> 100 */ containsMetadata(java.lang.String key)101 boolean containsMetadata(java.lang.String key); 102 /** Use {@link #getMetadataMap()} instead. */ 103 @java.lang.Deprecated getMetadata()104 java.util.Map<java.lang.String, java.lang.String> getMetadata(); 105 /** 106 * 107 * 108 * <pre> 109 * Metadata associated with the entity. 110 * For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) 111 * and Knowledge Graph MID (`mid`), if they are available. For the metadata 112 * associated with other entity types, see the Type table below. 113 * </pre> 114 * 115 * <code>map<string, string> metadata = 3;</code> 116 */ getMetadataMap()117 java.util.Map<java.lang.String, java.lang.String> getMetadataMap(); 118 /** 119 * 120 * 121 * <pre> 122 * Metadata associated with the entity. 123 * For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) 124 * and Knowledge Graph MID (`mid`), if they are available. For the metadata 125 * associated with other entity types, see the Type table below. 126 * </pre> 127 * 128 * <code>map<string, string> metadata = 3;</code> 129 */ 130 /* nullable */ getMetadataOrDefault( java.lang.String key, java.lang.String defaultValue)131 java.lang.String getMetadataOrDefault( 132 java.lang.String key, 133 /* nullable */ 134 java.lang.String defaultValue); 135 /** 136 * 137 * 138 * <pre> 139 * Metadata associated with the entity. 140 * For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) 141 * and Knowledge Graph MID (`mid`), if they are available. For the metadata 142 * associated with other entity types, see the Type table below. 143 * </pre> 144 * 145 * <code>map<string, string> metadata = 3;</code> 146 */ getMetadataOrThrow(java.lang.String key)147 java.lang.String getMetadataOrThrow(java.lang.String key); 148 149 /** 150 * 151 * 152 * <pre> 153 * The salience score associated with the entity in the [0, 1.0] range. 154 * The salience score for an entity provides information about the 155 * importance or centrality of that entity to the entire document text. 156 * Scores closer to 0 are less salient, while scores closer to 1.0 are highly 157 * salient. 158 * </pre> 159 * 160 * <code>float salience = 4;</code> 161 * 162 * @return The salience. 163 */ getSalience()164 float getSalience(); 165 166 /** 167 * 168 * 169 * <pre> 170 * The mentions of this entity in the input document. The API currently 171 * supports proper noun mentions. 172 * </pre> 173 * 174 * <code>repeated .google.cloud.language.v1.EntityMention mentions = 5;</code> 175 */ getMentionsList()176 java.util.List<com.google.cloud.language.v1.EntityMention> getMentionsList(); 177 /** 178 * 179 * 180 * <pre> 181 * The mentions of this entity in the input document. The API currently 182 * supports proper noun mentions. 183 * </pre> 184 * 185 * <code>repeated .google.cloud.language.v1.EntityMention mentions = 5;</code> 186 */ getMentions(int index)187 com.google.cloud.language.v1.EntityMention getMentions(int index); 188 /** 189 * 190 * 191 * <pre> 192 * The mentions of this entity in the input document. The API currently 193 * supports proper noun mentions. 194 * </pre> 195 * 196 * <code>repeated .google.cloud.language.v1.EntityMention mentions = 5;</code> 197 */ getMentionsCount()198 int getMentionsCount(); 199 /** 200 * 201 * 202 * <pre> 203 * The mentions of this entity in the input document. The API currently 204 * supports proper noun mentions. 205 * </pre> 206 * 207 * <code>repeated .google.cloud.language.v1.EntityMention mentions = 5;</code> 208 */ 209 java.util.List<? extends com.google.cloud.language.v1.EntityMentionOrBuilder> getMentionsOrBuilderList()210 getMentionsOrBuilderList(); 211 /** 212 * 213 * 214 * <pre> 215 * The mentions of this entity in the input document. The API currently 216 * supports proper noun mentions. 217 * </pre> 218 * 219 * <code>repeated .google.cloud.language.v1.EntityMention mentions = 5;</code> 220 */ getMentionsOrBuilder(int index)221 com.google.cloud.language.v1.EntityMentionOrBuilder getMentionsOrBuilder(int index); 222 223 /** 224 * 225 * 226 * <pre> 227 * For calls to [AnalyzeEntitySentiment][] or if 228 * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] 229 * is set to true, this field will contain the aggregate sentiment expressed 230 * for this entity in the provided document. 231 * </pre> 232 * 233 * <code>.google.cloud.language.v1.Sentiment sentiment = 6;</code> 234 * 235 * @return Whether the sentiment field is set. 236 */ hasSentiment()237 boolean hasSentiment(); 238 /** 239 * 240 * 241 * <pre> 242 * For calls to [AnalyzeEntitySentiment][] or if 243 * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] 244 * is set to true, this field will contain the aggregate sentiment expressed 245 * for this entity in the provided document. 246 * </pre> 247 * 248 * <code>.google.cloud.language.v1.Sentiment sentiment = 6;</code> 249 * 250 * @return The sentiment. 251 */ getSentiment()252 com.google.cloud.language.v1.Sentiment getSentiment(); 253 /** 254 * 255 * 256 * <pre> 257 * For calls to [AnalyzeEntitySentiment][] or if 258 * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] 259 * is set to true, this field will contain the aggregate sentiment expressed 260 * for this entity in the provided document. 261 * </pre> 262 * 263 * <code>.google.cloud.language.v1.Sentiment sentiment = 6;</code> 264 */ getSentimentOrBuilder()265 com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder(); 266 } 267