1// Code generated by protoc-gen-go. DO NOT EDIT. 2// source: google/cloud/vision/v1p4beta1/text_annotation.proto 3 4package vision 5 6import ( 7 fmt "fmt" 8 math "math" 9 10 proto "github.com/golang/protobuf/proto" 11 _ "google.golang.org/genproto/googleapis/api/annotations" 12) 13 14// Reference imports to suppress errors if they are not otherwise used. 15var _ = proto.Marshal 16var _ = fmt.Errorf 17var _ = math.Inf 18 19// This is a compile-time assertion to ensure that this generated file 20// is compatible with the proto package it is being compiled against. 21// A compilation error at this line likely means your copy of the 22// proto package needs to be updated. 23const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 24 25// Enum to denote the type of break found. New line, space etc. 26type TextAnnotation_DetectedBreak_BreakType int32 27 28const ( 29 // Unknown break label type. 30 TextAnnotation_DetectedBreak_UNKNOWN TextAnnotation_DetectedBreak_BreakType = 0 31 // Regular space. 32 TextAnnotation_DetectedBreak_SPACE TextAnnotation_DetectedBreak_BreakType = 1 33 // Sure space (very wide). 34 TextAnnotation_DetectedBreak_SURE_SPACE TextAnnotation_DetectedBreak_BreakType = 2 35 // Line-wrapping break. 36 TextAnnotation_DetectedBreak_EOL_SURE_SPACE TextAnnotation_DetectedBreak_BreakType = 3 37 // End-line hyphen that is not present in text; does not co-occur with 38 // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. 39 TextAnnotation_DetectedBreak_HYPHEN TextAnnotation_DetectedBreak_BreakType = 4 40 // Line break that ends a paragraph. 41 TextAnnotation_DetectedBreak_LINE_BREAK TextAnnotation_DetectedBreak_BreakType = 5 42) 43 44var TextAnnotation_DetectedBreak_BreakType_name = map[int32]string{ 45 0: "UNKNOWN", 46 1: "SPACE", 47 2: "SURE_SPACE", 48 3: "EOL_SURE_SPACE", 49 4: "HYPHEN", 50 5: "LINE_BREAK", 51} 52 53var TextAnnotation_DetectedBreak_BreakType_value = map[string]int32{ 54 "UNKNOWN": 0, 55 "SPACE": 1, 56 "SURE_SPACE": 2, 57 "EOL_SURE_SPACE": 3, 58 "HYPHEN": 4, 59 "LINE_BREAK": 5, 60} 61 62func (x TextAnnotation_DetectedBreak_BreakType) String() string { 63 return proto.EnumName(TextAnnotation_DetectedBreak_BreakType_name, int32(x)) 64} 65 66func (TextAnnotation_DetectedBreak_BreakType) EnumDescriptor() ([]byte, []int) { 67 return fileDescriptor_c423097b992ebbd5, []int{0, 1, 0} 68} 69 70// Type of a block (text, image etc) as identified by OCR. 71type Block_BlockType int32 72 73const ( 74 // Unknown block type. 75 Block_UNKNOWN Block_BlockType = 0 76 // Regular text block. 77 Block_TEXT Block_BlockType = 1 78 // Table block. 79 Block_TABLE Block_BlockType = 2 80 // Image block. 81 Block_PICTURE Block_BlockType = 3 82 // Horizontal/vertical line box. 83 Block_RULER Block_BlockType = 4 84 // Barcode block. 85 Block_BARCODE Block_BlockType = 5 86) 87 88var Block_BlockType_name = map[int32]string{ 89 0: "UNKNOWN", 90 1: "TEXT", 91 2: "TABLE", 92 3: "PICTURE", 93 4: "RULER", 94 5: "BARCODE", 95} 96 97var Block_BlockType_value = map[string]int32{ 98 "UNKNOWN": 0, 99 "TEXT": 1, 100 "TABLE": 2, 101 "PICTURE": 3, 102 "RULER": 4, 103 "BARCODE": 5, 104} 105 106func (x Block_BlockType) String() string { 107 return proto.EnumName(Block_BlockType_name, int32(x)) 108} 109 110func (Block_BlockType) EnumDescriptor() ([]byte, []int) { 111 return fileDescriptor_c423097b992ebbd5, []int{2, 0} 112} 113 114// TextAnnotation contains a structured representation of OCR extracted text. 115// The hierarchy of an OCR extracted text structure is like this: 116// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol 117// Each structural component, starting from Page, may further have their own 118// properties. Properties describe detected languages, breaks etc.. Please refer 119// to the 120// [TextAnnotation.TextProperty][google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty] 121// message definition below for more detail. 122type TextAnnotation struct { 123 // List of pages detected by OCR. 124 Pages []*Page `protobuf:"bytes,1,rep,name=pages,proto3" json:"pages,omitempty"` 125 // UTF-8 text detected on the pages. 126 Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` 127 XXX_NoUnkeyedLiteral struct{} `json:"-"` 128 XXX_unrecognized []byte `json:"-"` 129 XXX_sizecache int32 `json:"-"` 130} 131 132func (m *TextAnnotation) Reset() { *m = TextAnnotation{} } 133func (m *TextAnnotation) String() string { return proto.CompactTextString(m) } 134func (*TextAnnotation) ProtoMessage() {} 135func (*TextAnnotation) Descriptor() ([]byte, []int) { 136 return fileDescriptor_c423097b992ebbd5, []int{0} 137} 138 139func (m *TextAnnotation) XXX_Unmarshal(b []byte) error { 140 return xxx_messageInfo_TextAnnotation.Unmarshal(m, b) 141} 142func (m *TextAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 143 return xxx_messageInfo_TextAnnotation.Marshal(b, m, deterministic) 144} 145func (m *TextAnnotation) XXX_Merge(src proto.Message) { 146 xxx_messageInfo_TextAnnotation.Merge(m, src) 147} 148func (m *TextAnnotation) XXX_Size() int { 149 return xxx_messageInfo_TextAnnotation.Size(m) 150} 151func (m *TextAnnotation) XXX_DiscardUnknown() { 152 xxx_messageInfo_TextAnnotation.DiscardUnknown(m) 153} 154 155var xxx_messageInfo_TextAnnotation proto.InternalMessageInfo 156 157func (m *TextAnnotation) GetPages() []*Page { 158 if m != nil { 159 return m.Pages 160 } 161 return nil 162} 163 164func (m *TextAnnotation) GetText() string { 165 if m != nil { 166 return m.Text 167 } 168 return "" 169} 170 171// Detected language for a structural component. 172type TextAnnotation_DetectedLanguage struct { 173 // The BCP-47 language code, such as "en-US" or "sr-Latn". For more 174 // information, see 175 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 176 LanguageCode string `protobuf:"bytes,1,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` 177 // Confidence of detected language. Range [0, 1]. 178 Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"` 179 XXX_NoUnkeyedLiteral struct{} `json:"-"` 180 XXX_unrecognized []byte `json:"-"` 181 XXX_sizecache int32 `json:"-"` 182} 183 184func (m *TextAnnotation_DetectedLanguage) Reset() { *m = TextAnnotation_DetectedLanguage{} } 185func (m *TextAnnotation_DetectedLanguage) String() string { return proto.CompactTextString(m) } 186func (*TextAnnotation_DetectedLanguage) ProtoMessage() {} 187func (*TextAnnotation_DetectedLanguage) Descriptor() ([]byte, []int) { 188 return fileDescriptor_c423097b992ebbd5, []int{0, 0} 189} 190 191func (m *TextAnnotation_DetectedLanguage) XXX_Unmarshal(b []byte) error { 192 return xxx_messageInfo_TextAnnotation_DetectedLanguage.Unmarshal(m, b) 193} 194func (m *TextAnnotation_DetectedLanguage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 195 return xxx_messageInfo_TextAnnotation_DetectedLanguage.Marshal(b, m, deterministic) 196} 197func (m *TextAnnotation_DetectedLanguage) XXX_Merge(src proto.Message) { 198 xxx_messageInfo_TextAnnotation_DetectedLanguage.Merge(m, src) 199} 200func (m *TextAnnotation_DetectedLanguage) XXX_Size() int { 201 return xxx_messageInfo_TextAnnotation_DetectedLanguage.Size(m) 202} 203func (m *TextAnnotation_DetectedLanguage) XXX_DiscardUnknown() { 204 xxx_messageInfo_TextAnnotation_DetectedLanguage.DiscardUnknown(m) 205} 206 207var xxx_messageInfo_TextAnnotation_DetectedLanguage proto.InternalMessageInfo 208 209func (m *TextAnnotation_DetectedLanguage) GetLanguageCode() string { 210 if m != nil { 211 return m.LanguageCode 212 } 213 return "" 214} 215 216func (m *TextAnnotation_DetectedLanguage) GetConfidence() float32 { 217 if m != nil { 218 return m.Confidence 219 } 220 return 0 221} 222 223// Detected start or end of a structural component. 224type TextAnnotation_DetectedBreak struct { 225 // Detected break type. 226 Type TextAnnotation_DetectedBreak_BreakType `protobuf:"varint,1,opt,name=type,proto3,enum=google.cloud.vision.v1p4beta1.TextAnnotation_DetectedBreak_BreakType" json:"type,omitempty"` 227 // True if break prepends the element. 228 IsPrefix bool `protobuf:"varint,2,opt,name=is_prefix,json=isPrefix,proto3" json:"is_prefix,omitempty"` 229 XXX_NoUnkeyedLiteral struct{} `json:"-"` 230 XXX_unrecognized []byte `json:"-"` 231 XXX_sizecache int32 `json:"-"` 232} 233 234func (m *TextAnnotation_DetectedBreak) Reset() { *m = TextAnnotation_DetectedBreak{} } 235func (m *TextAnnotation_DetectedBreak) String() string { return proto.CompactTextString(m) } 236func (*TextAnnotation_DetectedBreak) ProtoMessage() {} 237func (*TextAnnotation_DetectedBreak) Descriptor() ([]byte, []int) { 238 return fileDescriptor_c423097b992ebbd5, []int{0, 1} 239} 240 241func (m *TextAnnotation_DetectedBreak) XXX_Unmarshal(b []byte) error { 242 return xxx_messageInfo_TextAnnotation_DetectedBreak.Unmarshal(m, b) 243} 244func (m *TextAnnotation_DetectedBreak) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 245 return xxx_messageInfo_TextAnnotation_DetectedBreak.Marshal(b, m, deterministic) 246} 247func (m *TextAnnotation_DetectedBreak) XXX_Merge(src proto.Message) { 248 xxx_messageInfo_TextAnnotation_DetectedBreak.Merge(m, src) 249} 250func (m *TextAnnotation_DetectedBreak) XXX_Size() int { 251 return xxx_messageInfo_TextAnnotation_DetectedBreak.Size(m) 252} 253func (m *TextAnnotation_DetectedBreak) XXX_DiscardUnknown() { 254 xxx_messageInfo_TextAnnotation_DetectedBreak.DiscardUnknown(m) 255} 256 257var xxx_messageInfo_TextAnnotation_DetectedBreak proto.InternalMessageInfo 258 259func (m *TextAnnotation_DetectedBreak) GetType() TextAnnotation_DetectedBreak_BreakType { 260 if m != nil { 261 return m.Type 262 } 263 return TextAnnotation_DetectedBreak_UNKNOWN 264} 265 266func (m *TextAnnotation_DetectedBreak) GetIsPrefix() bool { 267 if m != nil { 268 return m.IsPrefix 269 } 270 return false 271} 272 273// Additional information detected on the structural component. 274type TextAnnotation_TextProperty struct { 275 // A list of detected languages together with confidence. 276 DetectedLanguages []*TextAnnotation_DetectedLanguage `protobuf:"bytes,1,rep,name=detected_languages,json=detectedLanguages,proto3" json:"detected_languages,omitempty"` 277 // Detected start or end of a text segment. 278 DetectedBreak *TextAnnotation_DetectedBreak `protobuf:"bytes,2,opt,name=detected_break,json=detectedBreak,proto3" json:"detected_break,omitempty"` 279 XXX_NoUnkeyedLiteral struct{} `json:"-"` 280 XXX_unrecognized []byte `json:"-"` 281 XXX_sizecache int32 `json:"-"` 282} 283 284func (m *TextAnnotation_TextProperty) Reset() { *m = TextAnnotation_TextProperty{} } 285func (m *TextAnnotation_TextProperty) String() string { return proto.CompactTextString(m) } 286func (*TextAnnotation_TextProperty) ProtoMessage() {} 287func (*TextAnnotation_TextProperty) Descriptor() ([]byte, []int) { 288 return fileDescriptor_c423097b992ebbd5, []int{0, 2} 289} 290 291func (m *TextAnnotation_TextProperty) XXX_Unmarshal(b []byte) error { 292 return xxx_messageInfo_TextAnnotation_TextProperty.Unmarshal(m, b) 293} 294func (m *TextAnnotation_TextProperty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 295 return xxx_messageInfo_TextAnnotation_TextProperty.Marshal(b, m, deterministic) 296} 297func (m *TextAnnotation_TextProperty) XXX_Merge(src proto.Message) { 298 xxx_messageInfo_TextAnnotation_TextProperty.Merge(m, src) 299} 300func (m *TextAnnotation_TextProperty) XXX_Size() int { 301 return xxx_messageInfo_TextAnnotation_TextProperty.Size(m) 302} 303func (m *TextAnnotation_TextProperty) XXX_DiscardUnknown() { 304 xxx_messageInfo_TextAnnotation_TextProperty.DiscardUnknown(m) 305} 306 307var xxx_messageInfo_TextAnnotation_TextProperty proto.InternalMessageInfo 308 309func (m *TextAnnotation_TextProperty) GetDetectedLanguages() []*TextAnnotation_DetectedLanguage { 310 if m != nil { 311 return m.DetectedLanguages 312 } 313 return nil 314} 315 316func (m *TextAnnotation_TextProperty) GetDetectedBreak() *TextAnnotation_DetectedBreak { 317 if m != nil { 318 return m.DetectedBreak 319 } 320 return nil 321} 322 323// Detected page from OCR. 324type Page struct { 325 // Additional information detected on the page. 326 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 327 // Page width. For PDFs the unit is points. For images (including 328 // TIFFs) the unit is pixels. 329 Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` 330 // Page height. For PDFs the unit is points. For images (including 331 // TIFFs) the unit is pixels. 332 Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` 333 // List of blocks of text, images etc on this page. 334 Blocks []*Block `protobuf:"bytes,4,rep,name=blocks,proto3" json:"blocks,omitempty"` 335 // Confidence of the OCR results on the page. Range [0, 1]. 336 Confidence float32 `protobuf:"fixed32,5,opt,name=confidence,proto3" json:"confidence,omitempty"` 337 XXX_NoUnkeyedLiteral struct{} `json:"-"` 338 XXX_unrecognized []byte `json:"-"` 339 XXX_sizecache int32 `json:"-"` 340} 341 342func (m *Page) Reset() { *m = Page{} } 343func (m *Page) String() string { return proto.CompactTextString(m) } 344func (*Page) ProtoMessage() {} 345func (*Page) Descriptor() ([]byte, []int) { 346 return fileDescriptor_c423097b992ebbd5, []int{1} 347} 348 349func (m *Page) XXX_Unmarshal(b []byte) error { 350 return xxx_messageInfo_Page.Unmarshal(m, b) 351} 352func (m *Page) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 353 return xxx_messageInfo_Page.Marshal(b, m, deterministic) 354} 355func (m *Page) XXX_Merge(src proto.Message) { 356 xxx_messageInfo_Page.Merge(m, src) 357} 358func (m *Page) XXX_Size() int { 359 return xxx_messageInfo_Page.Size(m) 360} 361func (m *Page) XXX_DiscardUnknown() { 362 xxx_messageInfo_Page.DiscardUnknown(m) 363} 364 365var xxx_messageInfo_Page proto.InternalMessageInfo 366 367func (m *Page) GetProperty() *TextAnnotation_TextProperty { 368 if m != nil { 369 return m.Property 370 } 371 return nil 372} 373 374func (m *Page) GetWidth() int32 { 375 if m != nil { 376 return m.Width 377 } 378 return 0 379} 380 381func (m *Page) GetHeight() int32 { 382 if m != nil { 383 return m.Height 384 } 385 return 0 386} 387 388func (m *Page) GetBlocks() []*Block { 389 if m != nil { 390 return m.Blocks 391 } 392 return nil 393} 394 395func (m *Page) GetConfidence() float32 { 396 if m != nil { 397 return m.Confidence 398 } 399 return 0 400} 401 402// Logical element on the page. 403type Block struct { 404 // Additional information detected for the block. 405 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 406 // The bounding box for the block. 407 // The vertices are in the order of top-left, top-right, bottom-right, 408 // bottom-left. When a rotation of the bounding box is detected the rotation 409 // is represented as around the top-left corner as defined when the text is 410 // read in the 'natural' orientation. 411 // For example: 412 // 413 // * when the text is horizontal it might look like: 414 // 415 // 0----1 416 // | | 417 // 3----2 418 // 419 // * when it's rotated 180 degrees around the top-left corner it becomes: 420 // 421 // 2----3 422 // | | 423 // 1----0 424 // 425 // and the vertex order will still be (0, 1, 2, 3). 426 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 427 // List of paragraphs in this block (if this blocks is of type text). 428 Paragraphs []*Paragraph `protobuf:"bytes,3,rep,name=paragraphs,proto3" json:"paragraphs,omitempty"` 429 // Detected block type (text, image etc) for this block. 430 BlockType Block_BlockType `protobuf:"varint,4,opt,name=block_type,json=blockType,proto3,enum=google.cloud.vision.v1p4beta1.Block_BlockType" json:"block_type,omitempty"` 431 // Confidence of the OCR results on the block. Range [0, 1]. 432 Confidence float32 `protobuf:"fixed32,5,opt,name=confidence,proto3" json:"confidence,omitempty"` 433 XXX_NoUnkeyedLiteral struct{} `json:"-"` 434 XXX_unrecognized []byte `json:"-"` 435 XXX_sizecache int32 `json:"-"` 436} 437 438func (m *Block) Reset() { *m = Block{} } 439func (m *Block) String() string { return proto.CompactTextString(m) } 440func (*Block) ProtoMessage() {} 441func (*Block) Descriptor() ([]byte, []int) { 442 return fileDescriptor_c423097b992ebbd5, []int{2} 443} 444 445func (m *Block) XXX_Unmarshal(b []byte) error { 446 return xxx_messageInfo_Block.Unmarshal(m, b) 447} 448func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 449 return xxx_messageInfo_Block.Marshal(b, m, deterministic) 450} 451func (m *Block) XXX_Merge(src proto.Message) { 452 xxx_messageInfo_Block.Merge(m, src) 453} 454func (m *Block) XXX_Size() int { 455 return xxx_messageInfo_Block.Size(m) 456} 457func (m *Block) XXX_DiscardUnknown() { 458 xxx_messageInfo_Block.DiscardUnknown(m) 459} 460 461var xxx_messageInfo_Block proto.InternalMessageInfo 462 463func (m *Block) GetProperty() *TextAnnotation_TextProperty { 464 if m != nil { 465 return m.Property 466 } 467 return nil 468} 469 470func (m *Block) GetBoundingBox() *BoundingPoly { 471 if m != nil { 472 return m.BoundingBox 473 } 474 return nil 475} 476 477func (m *Block) GetParagraphs() []*Paragraph { 478 if m != nil { 479 return m.Paragraphs 480 } 481 return nil 482} 483 484func (m *Block) GetBlockType() Block_BlockType { 485 if m != nil { 486 return m.BlockType 487 } 488 return Block_UNKNOWN 489} 490 491func (m *Block) GetConfidence() float32 { 492 if m != nil { 493 return m.Confidence 494 } 495 return 0 496} 497 498// Structural unit of text representing a number of words in certain order. 499type Paragraph struct { 500 // Additional information detected for the paragraph. 501 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 502 // The bounding box for the paragraph. 503 // The vertices are in the order of top-left, top-right, bottom-right, 504 // bottom-left. When a rotation of the bounding box is detected the rotation 505 // is represented as around the top-left corner as defined when the text is 506 // read in the 'natural' orientation. 507 // For example: 508 // * when the text is horizontal it might look like: 509 // 0----1 510 // | | 511 // 3----2 512 // * when it's rotated 180 degrees around the top-left corner it becomes: 513 // 2----3 514 // | | 515 // 1----0 516 // and the vertex order will still be (0, 1, 2, 3). 517 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 518 // List of all words in this paragraph. 519 Words []*Word `protobuf:"bytes,3,rep,name=words,proto3" json:"words,omitempty"` 520 // Confidence of the OCR results for the paragraph. Range [0, 1]. 521 Confidence float32 `protobuf:"fixed32,4,opt,name=confidence,proto3" json:"confidence,omitempty"` 522 XXX_NoUnkeyedLiteral struct{} `json:"-"` 523 XXX_unrecognized []byte `json:"-"` 524 XXX_sizecache int32 `json:"-"` 525} 526 527func (m *Paragraph) Reset() { *m = Paragraph{} } 528func (m *Paragraph) String() string { return proto.CompactTextString(m) } 529func (*Paragraph) ProtoMessage() {} 530func (*Paragraph) Descriptor() ([]byte, []int) { 531 return fileDescriptor_c423097b992ebbd5, []int{3} 532} 533 534func (m *Paragraph) XXX_Unmarshal(b []byte) error { 535 return xxx_messageInfo_Paragraph.Unmarshal(m, b) 536} 537func (m *Paragraph) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 538 return xxx_messageInfo_Paragraph.Marshal(b, m, deterministic) 539} 540func (m *Paragraph) XXX_Merge(src proto.Message) { 541 xxx_messageInfo_Paragraph.Merge(m, src) 542} 543func (m *Paragraph) XXX_Size() int { 544 return xxx_messageInfo_Paragraph.Size(m) 545} 546func (m *Paragraph) XXX_DiscardUnknown() { 547 xxx_messageInfo_Paragraph.DiscardUnknown(m) 548} 549 550var xxx_messageInfo_Paragraph proto.InternalMessageInfo 551 552func (m *Paragraph) GetProperty() *TextAnnotation_TextProperty { 553 if m != nil { 554 return m.Property 555 } 556 return nil 557} 558 559func (m *Paragraph) GetBoundingBox() *BoundingPoly { 560 if m != nil { 561 return m.BoundingBox 562 } 563 return nil 564} 565 566func (m *Paragraph) GetWords() []*Word { 567 if m != nil { 568 return m.Words 569 } 570 return nil 571} 572 573func (m *Paragraph) GetConfidence() float32 { 574 if m != nil { 575 return m.Confidence 576 } 577 return 0 578} 579 580// A word representation. 581type Word struct { 582 // Additional information detected for the word. 583 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 584 // The bounding box for the word. 585 // The vertices are in the order of top-left, top-right, bottom-right, 586 // bottom-left. When a rotation of the bounding box is detected the rotation 587 // is represented as around the top-left corner as defined when the text is 588 // read in the 'natural' orientation. 589 // For example: 590 // * when the text is horizontal it might look like: 591 // 0----1 592 // | | 593 // 3----2 594 // * when it's rotated 180 degrees around the top-left corner it becomes: 595 // 2----3 596 // | | 597 // 1----0 598 // and the vertex order will still be (0, 1, 2, 3). 599 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 600 // List of symbols in the word. 601 // The order of the symbols follows the natural reading order. 602 Symbols []*Symbol `protobuf:"bytes,3,rep,name=symbols,proto3" json:"symbols,omitempty"` 603 // Confidence of the OCR results for the word. Range [0, 1]. 604 Confidence float32 `protobuf:"fixed32,4,opt,name=confidence,proto3" json:"confidence,omitempty"` 605 XXX_NoUnkeyedLiteral struct{} `json:"-"` 606 XXX_unrecognized []byte `json:"-"` 607 XXX_sizecache int32 `json:"-"` 608} 609 610func (m *Word) Reset() { *m = Word{} } 611func (m *Word) String() string { return proto.CompactTextString(m) } 612func (*Word) ProtoMessage() {} 613func (*Word) Descriptor() ([]byte, []int) { 614 return fileDescriptor_c423097b992ebbd5, []int{4} 615} 616 617func (m *Word) XXX_Unmarshal(b []byte) error { 618 return xxx_messageInfo_Word.Unmarshal(m, b) 619} 620func (m *Word) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 621 return xxx_messageInfo_Word.Marshal(b, m, deterministic) 622} 623func (m *Word) XXX_Merge(src proto.Message) { 624 xxx_messageInfo_Word.Merge(m, src) 625} 626func (m *Word) XXX_Size() int { 627 return xxx_messageInfo_Word.Size(m) 628} 629func (m *Word) XXX_DiscardUnknown() { 630 xxx_messageInfo_Word.DiscardUnknown(m) 631} 632 633var xxx_messageInfo_Word proto.InternalMessageInfo 634 635func (m *Word) GetProperty() *TextAnnotation_TextProperty { 636 if m != nil { 637 return m.Property 638 } 639 return nil 640} 641 642func (m *Word) GetBoundingBox() *BoundingPoly { 643 if m != nil { 644 return m.BoundingBox 645 } 646 return nil 647} 648 649func (m *Word) GetSymbols() []*Symbol { 650 if m != nil { 651 return m.Symbols 652 } 653 return nil 654} 655 656func (m *Word) GetConfidence() float32 { 657 if m != nil { 658 return m.Confidence 659 } 660 return 0 661} 662 663// A single symbol representation. 664type Symbol struct { 665 // Additional information detected for the symbol. 666 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 667 // The bounding box for the symbol. 668 // The vertices are in the order of top-left, top-right, bottom-right, 669 // bottom-left. When a rotation of the bounding box is detected the rotation 670 // is represented as around the top-left corner as defined when the text is 671 // read in the 'natural' orientation. 672 // For example: 673 // * when the text is horizontal it might look like: 674 // 0----1 675 // | | 676 // 3----2 677 // * when it's rotated 180 degrees around the top-left corner it becomes: 678 // 2----3 679 // | | 680 // 1----0 681 // and the vertex order will still be (0, 1, 2, 3). 682 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 683 // The actual UTF-8 representation of the symbol. 684 Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` 685 // Confidence of the OCR results for the symbol. Range [0, 1]. 686 Confidence float32 `protobuf:"fixed32,4,opt,name=confidence,proto3" json:"confidence,omitempty"` 687 XXX_NoUnkeyedLiteral struct{} `json:"-"` 688 XXX_unrecognized []byte `json:"-"` 689 XXX_sizecache int32 `json:"-"` 690} 691 692func (m *Symbol) Reset() { *m = Symbol{} } 693func (m *Symbol) String() string { return proto.CompactTextString(m) } 694func (*Symbol) ProtoMessage() {} 695func (*Symbol) Descriptor() ([]byte, []int) { 696 return fileDescriptor_c423097b992ebbd5, []int{5} 697} 698 699func (m *Symbol) XXX_Unmarshal(b []byte) error { 700 return xxx_messageInfo_Symbol.Unmarshal(m, b) 701} 702func (m *Symbol) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 703 return xxx_messageInfo_Symbol.Marshal(b, m, deterministic) 704} 705func (m *Symbol) XXX_Merge(src proto.Message) { 706 xxx_messageInfo_Symbol.Merge(m, src) 707} 708func (m *Symbol) XXX_Size() int { 709 return xxx_messageInfo_Symbol.Size(m) 710} 711func (m *Symbol) XXX_DiscardUnknown() { 712 xxx_messageInfo_Symbol.DiscardUnknown(m) 713} 714 715var xxx_messageInfo_Symbol proto.InternalMessageInfo 716 717func (m *Symbol) GetProperty() *TextAnnotation_TextProperty { 718 if m != nil { 719 return m.Property 720 } 721 return nil 722} 723 724func (m *Symbol) GetBoundingBox() *BoundingPoly { 725 if m != nil { 726 return m.BoundingBox 727 } 728 return nil 729} 730 731func (m *Symbol) GetText() string { 732 if m != nil { 733 return m.Text 734 } 735 return "" 736} 737 738func (m *Symbol) GetConfidence() float32 { 739 if m != nil { 740 return m.Confidence 741 } 742 return 0 743} 744 745func init() { 746 proto.RegisterEnum("google.cloud.vision.v1p4beta1.TextAnnotation_DetectedBreak_BreakType", TextAnnotation_DetectedBreak_BreakType_name, TextAnnotation_DetectedBreak_BreakType_value) 747 proto.RegisterEnum("google.cloud.vision.v1p4beta1.Block_BlockType", Block_BlockType_name, Block_BlockType_value) 748 proto.RegisterType((*TextAnnotation)(nil), "google.cloud.vision.v1p4beta1.TextAnnotation") 749 proto.RegisterType((*TextAnnotation_DetectedLanguage)(nil), "google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage") 750 proto.RegisterType((*TextAnnotation_DetectedBreak)(nil), "google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak") 751 proto.RegisterType((*TextAnnotation_TextProperty)(nil), "google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty") 752 proto.RegisterType((*Page)(nil), "google.cloud.vision.v1p4beta1.Page") 753 proto.RegisterType((*Block)(nil), "google.cloud.vision.v1p4beta1.Block") 754 proto.RegisterType((*Paragraph)(nil), "google.cloud.vision.v1p4beta1.Paragraph") 755 proto.RegisterType((*Word)(nil), "google.cloud.vision.v1p4beta1.Word") 756 proto.RegisterType((*Symbol)(nil), "google.cloud.vision.v1p4beta1.Symbol") 757} 758 759func init() { 760 proto.RegisterFile("google/cloud/vision/v1p4beta1/text_annotation.proto", fileDescriptor_c423097b992ebbd5) 761} 762 763var fileDescriptor_c423097b992ebbd5 = []byte{ 764 // 785 bytes of a gzipped FileDescriptorProto 765 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xdd, 0x6a, 0xdb, 0x48, 766 0x14, 0x5e, 0xd9, 0x92, 0x63, 0x1d, 0x27, 0x46, 0x3b, 0xbb, 0x2c, 0xc6, 0xfb, 0x43, 0xd6, 0xd9, 767 0x85, 0xc0, 0x2e, 0x32, 0x71, 0xf6, 0x26, 0x9b, 0xd2, 0x62, 0x39, 0xa2, 0x09, 0x71, 0x1d, 0x31, 768 0xb1, 0x93, 0xa6, 0x37, 0x42, 0x3f, 0x13, 0x59, 0xc4, 0xd6, 0x08, 0x49, 0x49, 0xec, 0x47, 0x28, 769 0x85, 0xf6, 0x1d, 0xfa, 0x1c, 0x7d, 0x99, 0x42, 0xaf, 0x4a, 0x1f, 0xa0, 0x97, 0x45, 0x23, 0xc9, 770 0xb1, 0x5d, 0x1a, 0xf5, 0x87, 0x5e, 0xe4, 0xc6, 0xcc, 0x39, 0x3e, 0xdf, 0x99, 0xf3, 0x7d, 0x67, 771 0x8e, 0x66, 0x60, 0xdb, 0xa1, 0xd4, 0x19, 0x91, 0xa6, 0x35, 0xa2, 0x97, 0x76, 0xf3, 0xca, 0x0d, 772 0x5d, 0xea, 0x35, 0xaf, 0xb6, 0xfc, 0xff, 0x4c, 0x12, 0x19, 0x5b, 0xcd, 0x88, 0x4c, 0x22, 0xdd, 773 0xf0, 0x3c, 0x1a, 0x19, 0x91, 0x4b, 0x3d, 0xd9, 0x0f, 0x68, 0x44, 0xd1, 0xef, 0x09, 0x48, 0x66, 774 0x20, 0x39, 0x01, 0xc9, 0x33, 0x50, 0xfd, 0xb7, 0x34, 0xa7, 0xe1, 0xbb, 0xcd, 0x1b, 0x6c, 0x98, 775 0x80, 0xeb, 0xff, 0xde, 0xbe, 0xa3, 0x43, 0xe8, 0x98, 0x44, 0xc1, 0x34, 0x89, 0x6e, 0x3c, 0x13, 776 0xa0, 0xda, 0x27, 0x93, 0xa8, 0x3d, 0xcb, 0x83, 0x76, 0x40, 0xf0, 0x0d, 0x87, 0x84, 0x35, 0x6e, 777 0xbd, 0xb8, 0x59, 0x69, 0x6d, 0xc8, 0xb7, 0x56, 0x23, 0x6b, 0x86, 0x43, 0x70, 0x82, 0x40, 0x08, 778 0xf8, 0x98, 0x51, 0xad, 0xb0, 0xce, 0x6d, 0x8a, 0x98, 0xad, 0xeb, 0xa7, 0x20, 0xed, 0x91, 0x88, 779 0x58, 0x11, 0xb1, 0xbb, 0x86, 0xe7, 0x5c, 0x1a, 0x0e, 0x41, 0x1b, 0xb0, 0x36, 0x4a, 0xd7, 0xba, 780 0x45, 0x6d, 0x52, 0xe3, 0x18, 0x60, 0x35, 0x73, 0x76, 0xa8, 0x4d, 0xd0, 0x1f, 0x00, 0x16, 0xf5, 781 0xce, 0x5d, 0x9b, 0x78, 0x16, 0x61, 0x29, 0x0b, 0x78, 0xce, 0x53, 0x7f, 0xc7, 0xc1, 0x5a, 0x96, 782 0x59, 0x09, 0x88, 0x71, 0x81, 0xce, 0x80, 0x8f, 0xa6, 0x7e, 0x92, 0xad, 0xda, 0x52, 0x73, 0x0a, 783 0x5f, 0xa4, 0x2d, 0x2f, 0xa4, 0x92, 0xd9, 0x6f, 0x7f, 0xea, 0x13, 0xcc, 0x52, 0xa2, 0x5f, 0x41, 784 0x74, 0x43, 0xdd, 0x0f, 0xc8, 0xb9, 0x3b, 0x61, 0xb5, 0x94, 0x71, 0xd9, 0x0d, 0x35, 0x66, 0x37, 785 0x2c, 0x10, 0x67, 0xf1, 0xa8, 0x02, 0x2b, 0x83, 0xde, 0x61, 0xef, 0xe8, 0xb4, 0x27, 0xfd, 0x80, 786 0x44, 0x10, 0x8e, 0xb5, 0x76, 0x47, 0x95, 0x38, 0x54, 0x05, 0x38, 0x1e, 0x60, 0x55, 0x4f, 0xec, 787 0x02, 0x42, 0x50, 0x55, 0x8f, 0xba, 0xfa, 0x9c, 0xaf, 0x88, 0x00, 0x4a, 0xfb, 0x67, 0xda, 0xbe, 788 0xda, 0x93, 0xf8, 0x38, 0xbe, 0x7b, 0xd0, 0x53, 0x75, 0x05, 0xab, 0xed, 0x43, 0x49, 0xa8, 0xbf, 789 0xe6, 0x60, 0x35, 0x2e, 0x59, 0x0b, 0xa8, 0x4f, 0x82, 0x68, 0x8a, 0xc6, 0x80, 0xec, 0xb4, 0x66, 790 0x3d, 0x13, 0x2e, 0x6b, 0xda, 0xfd, 0xaf, 0xe3, 0x9e, 0x35, 0x08, 0xff, 0x68, 0x2f, 0x79, 0x42, 791 0x64, 0x42, 0x75, 0xb6, 0x9d, 0x19, 0xb3, 0x65, 0x32, 0x54, 0x5a, 0xbb, 0xdf, 0x20, 0x33, 0x5e, 792 0xb3, 0xe7, 0xcd, 0xc6, 0x5b, 0x0e, 0xf8, 0xf8, 0x3c, 0xa1, 0x13, 0x28, 0xfb, 0x29, 0x4f, 0xd6, 793 0xcd, 0x4a, 0xeb, 0xff, 0x2f, 0xdb, 0x66, 0x5e, 0x29, 0x3c, 0xcb, 0x85, 0x7e, 0x06, 0xe1, 0xda, 794 0xb5, 0xa3, 0x21, 0xab, 0x5d, 0xc0, 0x89, 0x81, 0x7e, 0x81, 0xd2, 0x90, 0xb8, 0xce, 0x30, 0xaa, 795 0x15, 0x99, 0x3b, 0xb5, 0xd0, 0x3d, 0x28, 0x99, 0x23, 0x6a, 0x5d, 0x84, 0x35, 0x9e, 0xa9, 0xfa, 796 0x57, 0x4e, 0x0d, 0x4a, 0x1c, 0x8c, 0x53, 0xcc, 0xd2, 0xf9, 0x15, 0x96, 0xcf, 0x6f, 0xe3, 0x55, 797 0x11, 0x04, 0x86, 0xf8, 0x6e, 0x6c, 0x7b, 0xb0, 0x6a, 0xd2, 0x4b, 0xcf, 0x76, 0x3d, 0x47, 0x37, 798 0xe9, 0x24, 0x6d, 0xd8, 0x3f, 0x79, 0x2c, 0x52, 0x88, 0x46, 0x47, 0x53, 0x5c, 0xc9, 0x12, 0x28, 799 0x74, 0x82, 0xf6, 0x01, 0x7c, 0x23, 0x30, 0x9c, 0xc0, 0xf0, 0x87, 0x61, 0xad, 0xc8, 0x34, 0xd9, 800 0xcc, 0xfd, 0x3c, 0xa4, 0x00, 0x3c, 0x87, 0x45, 0x8f, 0x00, 0x98, 0x4a, 0x3a, 0x9b, 0x57, 0x9e, 801 0xcd, 0xab, 0xfc, 0x39, 0xea, 0x26, 0xbf, 0x6c, 0x30, 0x45, 0x33, 0x5b, 0xe6, 0x4a, 0x8d, 0x41, 802 0x9c, 0xe1, 0x16, 0x07, 0xb4, 0x0c, 0x7c, 0x5f, 0x7d, 0xdc, 0x97, 0xb8, 0x78, 0x54, 0xfb, 0x6d, 803 0xa5, 0x1b, 0x8f, 0x66, 0x05, 0x56, 0xb4, 0x83, 0x4e, 0x7f, 0x80, 0xe3, 0x99, 0x14, 0x41, 0xc0, 804 0x83, 0xae, 0x8a, 0x25, 0x3e, 0xf6, 0x2b, 0x6d, 0xdc, 0x39, 0xda, 0x53, 0x25, 0xa1, 0xf1, 0xbc, 805 0x00, 0xe2, 0x8c, 0xdc, 0x9d, 0x69, 0xe1, 0x0e, 0x08, 0xd7, 0x34, 0xb0, 0xb3, 0xee, 0xe5, 0x7d, 806 0xdc, 0x4f, 0x69, 0x60, 0xe3, 0x04, 0xb1, 0x24, 0x32, 0xff, 0x91, 0xc8, 0x2f, 0x0a, 0xc0, 0xc7, 807 0xf1, 0x77, 0x46, 0x8b, 0x07, 0xb0, 0x12, 0x4e, 0xc7, 0x26, 0x1d, 0x65, 0x6a, 0xfc, 0x9d, 0x93, 808 0xea, 0x98, 0x45, 0xe3, 0x0c, 0x95, 0xab, 0xc8, 0x1b, 0x0e, 0x4a, 0x09, 0xe6, 0xce, 0x68, 0x92, 809 0xdd, 0xe0, 0xc5, 0x9b, 0x1b, 0x3c, 0x8f, 0xa6, 0xf2, 0x94, 0x83, 0x3f, 0x2d, 0x3a, 0xbe, 0x7d, 810 0x4f, 0xe5, 0xa7, 0x45, 0x42, 0x5a, 0xfc, 0xfc, 0xd0, 0xb8, 0x27, 0x9d, 0x14, 0xe5, 0xd0, 0xf8, 811 0x0e, 0x93, 0x69, 0xe0, 0x34, 0x1d, 0xe2, 0xb1, 0xc7, 0x49, 0x33, 0xf9, 0xcb, 0xf0, 0xdd, 0xf0, 812 0x13, 0xaf, 0x99, 0xdd, 0xc4, 0xf1, 0x9e, 0xe3, 0x5e, 0x16, 0xf8, 0x87, 0x9d, 0x93, 0x9e, 0x59, 813 0x62, 0xc8, 0xed, 0x0f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x30, 0xc7, 0x3a, 0x78, 0x09, 0x00, 814 0x00, 815} 816