1// Code generated by protoc-gen-go. DO NOT EDIT. 2// source: google/cloud/vision/v1p1beta1/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_74ab7e2078bf72c5, []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_74ab7e2078bf72c5, []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.v1p1beta1.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_74ab7e2078bf72c5, []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_74ab7e2078bf72c5, []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.v1p1beta1.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_74ab7e2078bf72c5, []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_74ab7e2078bf72c5, []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 in pixels. 328 Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` 329 // Page height in pixels. 330 Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` 331 // List of blocks of text, images etc on this page. 332 Blocks []*Block `protobuf:"bytes,4,rep,name=blocks,proto3" json:"blocks,omitempty"` 333 // Confidence of the OCR results on the page. Range [0, 1]. 334 Confidence float32 `protobuf:"fixed32,5,opt,name=confidence,proto3" json:"confidence,omitempty"` 335 XXX_NoUnkeyedLiteral struct{} `json:"-"` 336 XXX_unrecognized []byte `json:"-"` 337 XXX_sizecache int32 `json:"-"` 338} 339 340func (m *Page) Reset() { *m = Page{} } 341func (m *Page) String() string { return proto.CompactTextString(m) } 342func (*Page) ProtoMessage() {} 343func (*Page) Descriptor() ([]byte, []int) { 344 return fileDescriptor_74ab7e2078bf72c5, []int{1} 345} 346 347func (m *Page) XXX_Unmarshal(b []byte) error { 348 return xxx_messageInfo_Page.Unmarshal(m, b) 349} 350func (m *Page) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 351 return xxx_messageInfo_Page.Marshal(b, m, deterministic) 352} 353func (m *Page) XXX_Merge(src proto.Message) { 354 xxx_messageInfo_Page.Merge(m, src) 355} 356func (m *Page) XXX_Size() int { 357 return xxx_messageInfo_Page.Size(m) 358} 359func (m *Page) XXX_DiscardUnknown() { 360 xxx_messageInfo_Page.DiscardUnknown(m) 361} 362 363var xxx_messageInfo_Page proto.InternalMessageInfo 364 365func (m *Page) GetProperty() *TextAnnotation_TextProperty { 366 if m != nil { 367 return m.Property 368 } 369 return nil 370} 371 372func (m *Page) GetWidth() int32 { 373 if m != nil { 374 return m.Width 375 } 376 return 0 377} 378 379func (m *Page) GetHeight() int32 { 380 if m != nil { 381 return m.Height 382 } 383 return 0 384} 385 386func (m *Page) GetBlocks() []*Block { 387 if m != nil { 388 return m.Blocks 389 } 390 return nil 391} 392 393func (m *Page) GetConfidence() float32 { 394 if m != nil { 395 return m.Confidence 396 } 397 return 0 398} 399 400// Logical element on the page. 401type Block struct { 402 // Additional information detected for the block. 403 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 404 // The bounding box for the block. 405 // The vertices are in the order of top-left, top-right, bottom-right, 406 // bottom-left. When a rotation of the bounding box is detected the rotation 407 // is represented as around the top-left corner as defined when the text is 408 // read in the 'natural' orientation. 409 // For example: 410 // * when the text is horizontal it might look like: 411 // 0----1 412 // | | 413 // 3----2 414 // * when it's rotated 180 degrees around the top-left corner it becomes: 415 // 2----3 416 // | | 417 // 1----0 418 // and the vertice order will still be (0, 1, 2, 3). 419 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 420 // List of paragraphs in this block (if this blocks is of type text). 421 Paragraphs []*Paragraph `protobuf:"bytes,3,rep,name=paragraphs,proto3" json:"paragraphs,omitempty"` 422 // Detected block type (text, image etc) for this block. 423 BlockType Block_BlockType `protobuf:"varint,4,opt,name=block_type,json=blockType,proto3,enum=google.cloud.vision.v1p1beta1.Block_BlockType" json:"block_type,omitempty"` 424 // Confidence of the OCR results on the block. Range [0, 1]. 425 Confidence float32 `protobuf:"fixed32,5,opt,name=confidence,proto3" json:"confidence,omitempty"` 426 XXX_NoUnkeyedLiteral struct{} `json:"-"` 427 XXX_unrecognized []byte `json:"-"` 428 XXX_sizecache int32 `json:"-"` 429} 430 431func (m *Block) Reset() { *m = Block{} } 432func (m *Block) String() string { return proto.CompactTextString(m) } 433func (*Block) ProtoMessage() {} 434func (*Block) Descriptor() ([]byte, []int) { 435 return fileDescriptor_74ab7e2078bf72c5, []int{2} 436} 437 438func (m *Block) XXX_Unmarshal(b []byte) error { 439 return xxx_messageInfo_Block.Unmarshal(m, b) 440} 441func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 442 return xxx_messageInfo_Block.Marshal(b, m, deterministic) 443} 444func (m *Block) XXX_Merge(src proto.Message) { 445 xxx_messageInfo_Block.Merge(m, src) 446} 447func (m *Block) XXX_Size() int { 448 return xxx_messageInfo_Block.Size(m) 449} 450func (m *Block) XXX_DiscardUnknown() { 451 xxx_messageInfo_Block.DiscardUnknown(m) 452} 453 454var xxx_messageInfo_Block proto.InternalMessageInfo 455 456func (m *Block) GetProperty() *TextAnnotation_TextProperty { 457 if m != nil { 458 return m.Property 459 } 460 return nil 461} 462 463func (m *Block) GetBoundingBox() *BoundingPoly { 464 if m != nil { 465 return m.BoundingBox 466 } 467 return nil 468} 469 470func (m *Block) GetParagraphs() []*Paragraph { 471 if m != nil { 472 return m.Paragraphs 473 } 474 return nil 475} 476 477func (m *Block) GetBlockType() Block_BlockType { 478 if m != nil { 479 return m.BlockType 480 } 481 return Block_UNKNOWN 482} 483 484func (m *Block) GetConfidence() float32 { 485 if m != nil { 486 return m.Confidence 487 } 488 return 0 489} 490 491// Structural unit of text representing a number of words in certain order. 492type Paragraph struct { 493 // Additional information detected for the paragraph. 494 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 495 // The bounding box for the paragraph. 496 // The vertices are in the order of top-left, top-right, bottom-right, 497 // bottom-left. When a rotation of the bounding box is detected the rotation 498 // is represented as around the top-left corner as defined when the text is 499 // read in the 'natural' orientation. 500 // For example: 501 // * when the text is horizontal it might look like: 502 // 0----1 503 // | | 504 // 3----2 505 // * when it's rotated 180 degrees around the top-left corner it becomes: 506 // 2----3 507 // | | 508 // 1----0 509 // and the vertice order will still be (0, 1, 2, 3). 510 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 511 // List of words in this paragraph. 512 Words []*Word `protobuf:"bytes,3,rep,name=words,proto3" json:"words,omitempty"` 513 // Confidence of the OCR results for the paragraph. Range [0, 1]. 514 Confidence float32 `protobuf:"fixed32,4,opt,name=confidence,proto3" json:"confidence,omitempty"` 515 XXX_NoUnkeyedLiteral struct{} `json:"-"` 516 XXX_unrecognized []byte `json:"-"` 517 XXX_sizecache int32 `json:"-"` 518} 519 520func (m *Paragraph) Reset() { *m = Paragraph{} } 521func (m *Paragraph) String() string { return proto.CompactTextString(m) } 522func (*Paragraph) ProtoMessage() {} 523func (*Paragraph) Descriptor() ([]byte, []int) { 524 return fileDescriptor_74ab7e2078bf72c5, []int{3} 525} 526 527func (m *Paragraph) XXX_Unmarshal(b []byte) error { 528 return xxx_messageInfo_Paragraph.Unmarshal(m, b) 529} 530func (m *Paragraph) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 531 return xxx_messageInfo_Paragraph.Marshal(b, m, deterministic) 532} 533func (m *Paragraph) XXX_Merge(src proto.Message) { 534 xxx_messageInfo_Paragraph.Merge(m, src) 535} 536func (m *Paragraph) XXX_Size() int { 537 return xxx_messageInfo_Paragraph.Size(m) 538} 539func (m *Paragraph) XXX_DiscardUnknown() { 540 xxx_messageInfo_Paragraph.DiscardUnknown(m) 541} 542 543var xxx_messageInfo_Paragraph proto.InternalMessageInfo 544 545func (m *Paragraph) GetProperty() *TextAnnotation_TextProperty { 546 if m != nil { 547 return m.Property 548 } 549 return nil 550} 551 552func (m *Paragraph) GetBoundingBox() *BoundingPoly { 553 if m != nil { 554 return m.BoundingBox 555 } 556 return nil 557} 558 559func (m *Paragraph) GetWords() []*Word { 560 if m != nil { 561 return m.Words 562 } 563 return nil 564} 565 566func (m *Paragraph) GetConfidence() float32 { 567 if m != nil { 568 return m.Confidence 569 } 570 return 0 571} 572 573// A word representation. 574type Word struct { 575 // Additional information detected for the word. 576 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 577 // The bounding box for the word. 578 // The vertices are in the order of top-left, top-right, bottom-right, 579 // bottom-left. When a rotation of the bounding box is detected the rotation 580 // is represented as around the top-left corner as defined when the text is 581 // read in the 'natural' orientation. 582 // For example: 583 // * when the text is horizontal it might look like: 584 // 0----1 585 // | | 586 // 3----2 587 // * when it's rotated 180 degrees around the top-left corner it becomes: 588 // 2----3 589 // | | 590 // 1----0 591 // and the vertice order will still be (0, 1, 2, 3). 592 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 593 // List of symbols in the word. 594 // The order of the symbols follows the natural reading order. 595 Symbols []*Symbol `protobuf:"bytes,3,rep,name=symbols,proto3" json:"symbols,omitempty"` 596 // Confidence of the OCR results for the word. Range [0, 1]. 597 Confidence float32 `protobuf:"fixed32,4,opt,name=confidence,proto3" json:"confidence,omitempty"` 598 XXX_NoUnkeyedLiteral struct{} `json:"-"` 599 XXX_unrecognized []byte `json:"-"` 600 XXX_sizecache int32 `json:"-"` 601} 602 603func (m *Word) Reset() { *m = Word{} } 604func (m *Word) String() string { return proto.CompactTextString(m) } 605func (*Word) ProtoMessage() {} 606func (*Word) Descriptor() ([]byte, []int) { 607 return fileDescriptor_74ab7e2078bf72c5, []int{4} 608} 609 610func (m *Word) XXX_Unmarshal(b []byte) error { 611 return xxx_messageInfo_Word.Unmarshal(m, b) 612} 613func (m *Word) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 614 return xxx_messageInfo_Word.Marshal(b, m, deterministic) 615} 616func (m *Word) XXX_Merge(src proto.Message) { 617 xxx_messageInfo_Word.Merge(m, src) 618} 619func (m *Word) XXX_Size() int { 620 return xxx_messageInfo_Word.Size(m) 621} 622func (m *Word) XXX_DiscardUnknown() { 623 xxx_messageInfo_Word.DiscardUnknown(m) 624} 625 626var xxx_messageInfo_Word proto.InternalMessageInfo 627 628func (m *Word) GetProperty() *TextAnnotation_TextProperty { 629 if m != nil { 630 return m.Property 631 } 632 return nil 633} 634 635func (m *Word) GetBoundingBox() *BoundingPoly { 636 if m != nil { 637 return m.BoundingBox 638 } 639 return nil 640} 641 642func (m *Word) GetSymbols() []*Symbol { 643 if m != nil { 644 return m.Symbols 645 } 646 return nil 647} 648 649func (m *Word) GetConfidence() float32 { 650 if m != nil { 651 return m.Confidence 652 } 653 return 0 654} 655 656// A single symbol representation. 657type Symbol struct { 658 // Additional information detected for the symbol. 659 Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"` 660 // The bounding box for the symbol. 661 // The vertices are in the order of top-left, top-right, bottom-right, 662 // bottom-left. When a rotation of the bounding box is detected the rotation 663 // is represented as around the top-left corner as defined when the text is 664 // read in the 'natural' orientation. 665 // For example: 666 // * when the text is horizontal it might look like: 667 // 0----1 668 // | | 669 // 3----2 670 // * when it's rotated 180 degrees around the top-left corner it becomes: 671 // 2----3 672 // | | 673 // 1----0 674 // and the vertice order will still be (0, 1, 2, 3). 675 BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 676 // The actual UTF-8 representation of the symbol. 677 Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` 678 // Confidence of the OCR results for the symbol. Range [0, 1]. 679 Confidence float32 `protobuf:"fixed32,4,opt,name=confidence,proto3" json:"confidence,omitempty"` 680 XXX_NoUnkeyedLiteral struct{} `json:"-"` 681 XXX_unrecognized []byte `json:"-"` 682 XXX_sizecache int32 `json:"-"` 683} 684 685func (m *Symbol) Reset() { *m = Symbol{} } 686func (m *Symbol) String() string { return proto.CompactTextString(m) } 687func (*Symbol) ProtoMessage() {} 688func (*Symbol) Descriptor() ([]byte, []int) { 689 return fileDescriptor_74ab7e2078bf72c5, []int{5} 690} 691 692func (m *Symbol) XXX_Unmarshal(b []byte) error { 693 return xxx_messageInfo_Symbol.Unmarshal(m, b) 694} 695func (m *Symbol) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 696 return xxx_messageInfo_Symbol.Marshal(b, m, deterministic) 697} 698func (m *Symbol) XXX_Merge(src proto.Message) { 699 xxx_messageInfo_Symbol.Merge(m, src) 700} 701func (m *Symbol) XXX_Size() int { 702 return xxx_messageInfo_Symbol.Size(m) 703} 704func (m *Symbol) XXX_DiscardUnknown() { 705 xxx_messageInfo_Symbol.DiscardUnknown(m) 706} 707 708var xxx_messageInfo_Symbol proto.InternalMessageInfo 709 710func (m *Symbol) GetProperty() *TextAnnotation_TextProperty { 711 if m != nil { 712 return m.Property 713 } 714 return nil 715} 716 717func (m *Symbol) GetBoundingBox() *BoundingPoly { 718 if m != nil { 719 return m.BoundingBox 720 } 721 return nil 722} 723 724func (m *Symbol) GetText() string { 725 if m != nil { 726 return m.Text 727 } 728 return "" 729} 730 731func (m *Symbol) GetConfidence() float32 { 732 if m != nil { 733 return m.Confidence 734 } 735 return 0 736} 737 738func init() { 739 proto.RegisterEnum("google.cloud.vision.v1p1beta1.TextAnnotation_DetectedBreak_BreakType", TextAnnotation_DetectedBreak_BreakType_name, TextAnnotation_DetectedBreak_BreakType_value) 740 proto.RegisterEnum("google.cloud.vision.v1p1beta1.Block_BlockType", Block_BlockType_name, Block_BlockType_value) 741 proto.RegisterType((*TextAnnotation)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation") 742 proto.RegisterType((*TextAnnotation_DetectedLanguage)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage") 743 proto.RegisterType((*TextAnnotation_DetectedBreak)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak") 744 proto.RegisterType((*TextAnnotation_TextProperty)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty") 745 proto.RegisterType((*Page)(nil), "google.cloud.vision.v1p1beta1.Page") 746 proto.RegisterType((*Block)(nil), "google.cloud.vision.v1p1beta1.Block") 747 proto.RegisterType((*Paragraph)(nil), "google.cloud.vision.v1p1beta1.Paragraph") 748 proto.RegisterType((*Word)(nil), "google.cloud.vision.v1p1beta1.Word") 749 proto.RegisterType((*Symbol)(nil), "google.cloud.vision.v1p1beta1.Symbol") 750} 751 752func init() { 753 proto.RegisterFile("google/cloud/vision/v1p1beta1/text_annotation.proto", fileDescriptor_74ab7e2078bf72c5) 754} 755 756var fileDescriptor_74ab7e2078bf72c5 = []byte{ 757 // 775 bytes of a gzipped FileDescriptorProto 758 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0xd3, 0x48, 759 0x14, 0x5f, 0x27, 0x76, 0x1a, 0xbf, 0xb4, 0x91, 0x77, 0x76, 0xb5, 0x8a, 0xb2, 0xbb, 0xa8, 0xa4, 760 0x20, 0x55, 0x02, 0x39, 0x6a, 0x7a, 0x2a, 0x45, 0xa0, 0x38, 0xb5, 0xd4, 0xaa, 0x21, 0xb5, 0xa6, 761 0x09, 0xa5, 0x5c, 0x2c, 0xff, 0x99, 0x3a, 0x56, 0x13, 0x8f, 0x65, 0xbb, 0x6d, 0x72, 0xe5, 0x8a, 762 0x04, 0x5f, 0x88, 0x2f, 0x83, 0xc4, 0x09, 0xf1, 0x01, 0x38, 0x22, 0x8f, 0xed, 0x34, 0x09, 0xa2, 763 0xe6, 0x8f, 0x38, 0xf4, 0x12, 0xcd, 0x7b, 0x79, 0xbf, 0x37, 0xef, 0xf7, 0x7b, 0xf3, 0x3c, 0x03, 764 0xdb, 0x0e, 0xa5, 0xce, 0x88, 0x34, 0xad, 0x11, 0xbd, 0xb0, 0x9b, 0x97, 0x6e, 0xe8, 0x52, 0xaf, 765 0x79, 0xb9, 0xe5, 0x6f, 0x99, 0x24, 0x32, 0xb6, 0x9a, 0x11, 0x99, 0x44, 0xba, 0xe1, 0x79, 0x34, 766 0x32, 0x22, 0x97, 0x7a, 0xb2, 0x1f, 0xd0, 0x88, 0xa2, 0xff, 0x13, 0x90, 0xcc, 0x40, 0x72, 0x02, 767 0x92, 0x67, 0xa0, 0xfa, 0x7f, 0x69, 0x4e, 0xc3, 0x77, 0x9b, 0xd7, 0xd8, 0x30, 0x01, 0xd7, 0x1f, 768 0xde, 0xbc, 0xa3, 0x43, 0xe8, 0x98, 0x44, 0xc1, 0x34, 0x89, 0x6e, 0xbc, 0x16, 0xa0, 0xda, 0x27, 769 0x93, 0xa8, 0x3d, 0xcb, 0x83, 0x76, 0x40, 0xf0, 0x0d, 0x87, 0x84, 0x35, 0x6e, 0xbd, 0xb8, 0x59, 770 0x69, 0x6d, 0xc8, 0x37, 0x56, 0x23, 0x6b, 0x86, 0x43, 0x70, 0x82, 0x40, 0x08, 0xf8, 0x98, 0x51, 771 0xad, 0xb0, 0xce, 0x6d, 0x8a, 0x98, 0xad, 0xeb, 0x27, 0x20, 0xed, 0x91, 0x88, 0x58, 0x11, 0xb1, 772 0xbb, 0x86, 0xe7, 0x5c, 0x18, 0x0e, 0x41, 0x1b, 0xb0, 0x36, 0x4a, 0xd7, 0xba, 0x45, 0x6d, 0x52, 773 0xe3, 0x18, 0x60, 0x35, 0x73, 0x76, 0xa8, 0x4d, 0xd0, 0x1d, 0x00, 0x8b, 0x7a, 0x67, 0xae, 0x4d, 774 0x3c, 0x8b, 0xb0, 0x94, 0x05, 0x3c, 0xe7, 0xa9, 0x7f, 0xe2, 0x60, 0x2d, 0xcb, 0xac, 0x04, 0xc4, 775 0x38, 0x47, 0xa7, 0xc0, 0x47, 0x53, 0x3f, 0xc9, 0x56, 0x6d, 0xa9, 0x39, 0x85, 0x2f, 0xd2, 0x96, 776 0x17, 0x52, 0xc9, 0xec, 0xb7, 0x3f, 0xf5, 0x09, 0x66, 0x29, 0xd1, 0xbf, 0x20, 0xba, 0xa1, 0xee, 777 0x07, 0xe4, 0xcc, 0x9d, 0xb0, 0x5a, 0xca, 0xb8, 0xec, 0x86, 0x1a, 0xb3, 0x1b, 0x16, 0x88, 0xb3, 778 0x78, 0x54, 0x81, 0x95, 0x41, 0xef, 0xb0, 0x77, 0x74, 0xd2, 0x93, 0xfe, 0x40, 0x22, 0x08, 0xc7, 779 0x5a, 0xbb, 0xa3, 0x4a, 0x1c, 0xaa, 0x02, 0x1c, 0x0f, 0xb0, 0xaa, 0x27, 0x76, 0x01, 0x21, 0xa8, 780 0xaa, 0x47, 0x5d, 0x7d, 0xce, 0x57, 0x44, 0x00, 0xa5, 0xfd, 0x53, 0x6d, 0x5f, 0xed, 0x49, 0x7c, 781 0x1c, 0xdf, 0x3d, 0xe8, 0xa9, 0xba, 0x82, 0xd5, 0xf6, 0xa1, 0x24, 0xd4, 0xdf, 0x73, 0xb0, 0x1a, 782 0x97, 0xac, 0x05, 0xd4, 0x27, 0x41, 0x34, 0x45, 0x63, 0x40, 0x76, 0x5a, 0xb3, 0x9e, 0x09, 0x97, 783 0x35, 0xed, 0xc9, 0xcf, 0x71, 0xcf, 0x1a, 0x84, 0xff, 0xb4, 0x97, 0x3c, 0x21, 0x32, 0xa1, 0x3a, 784 0xdb, 0xce, 0x8c, 0xd9, 0x32, 0x19, 0x2a, 0xad, 0xdd, 0x5f, 0x90, 0x19, 0xaf, 0xd9, 0xf3, 0x66, 785 0xe3, 0x23, 0x07, 0x7c, 0x7c, 0x9e, 0xd0, 0x73, 0x28, 0xfb, 0x29, 0x4f, 0xd6, 0xcd, 0x4a, 0xeb, 786 0xd1, 0x8f, 0x6d, 0x33, 0xaf, 0x14, 0x9e, 0xe5, 0x42, 0x7f, 0x83, 0x70, 0xe5, 0xda, 0xd1, 0x90, 787 0xd5, 0x2e, 0xe0, 0xc4, 0x40, 0xff, 0x40, 0x69, 0x48, 0x5c, 0x67, 0x18, 0xd5, 0x8a, 0xcc, 0x9d, 788 0x5a, 0xe8, 0x31, 0x94, 0xcc, 0x11, 0xb5, 0xce, 0xc3, 0x1a, 0xcf, 0x54, 0xbd, 0x97, 0x53, 0x83, 789 0x12, 0x07, 0xe3, 0x14, 0xb3, 0x74, 0x7e, 0x85, 0xe5, 0xf3, 0xdb, 0x78, 0x57, 0x04, 0x81, 0x21, 790 0x7e, 0x1b, 0xdb, 0x1e, 0xac, 0x9a, 0xf4, 0xc2, 0xb3, 0x5d, 0xcf, 0xd1, 0x4d, 0x3a, 0x49, 0x1b, 791 0xf6, 0x20, 0x8f, 0x45, 0x0a, 0xd1, 0xe8, 0x68, 0x8a, 0x2b, 0x59, 0x02, 0x85, 0x4e, 0xd0, 0x3e, 792 0x80, 0x6f, 0x04, 0x86, 0x13, 0x18, 0xfe, 0x30, 0xac, 0x15, 0x99, 0x26, 0x9b, 0xb9, 0x9f, 0x87, 793 0x14, 0x80, 0xe7, 0xb0, 0xe8, 0x19, 0x00, 0x53, 0x49, 0x67, 0xf3, 0xca, 0xb3, 0x79, 0x95, 0xbf, 794 0x47, 0xdd, 0xe4, 0x97, 0x0d, 0xa6, 0x68, 0x66, 0xcb, 0x5c, 0xa9, 0x31, 0x88, 0x33, 0xdc, 0xe2, 795 0x80, 0x96, 0x81, 0xef, 0xab, 0x2f, 0xfa, 0x12, 0x17, 0x8f, 0x6a, 0xbf, 0xad, 0x74, 0xe3, 0xd1, 796 0xac, 0xc0, 0x8a, 0x76, 0xd0, 0xe9, 0x0f, 0x70, 0x3c, 0x93, 0x22, 0x08, 0x78, 0xd0, 0x55, 0xb1, 797 0xc4, 0xc7, 0x7e, 0xa5, 0x8d, 0x3b, 0x47, 0x7b, 0xaa, 0x24, 0x34, 0xde, 0x14, 0x40, 0x9c, 0x91, 798 0xbb, 0x35, 0x2d, 0xdc, 0x01, 0xe1, 0x8a, 0x06, 0x76, 0xd6, 0xbd, 0xbc, 0x8f, 0xfb, 0x09, 0x0d, 799 0x6c, 0x9c, 0x20, 0x96, 0x44, 0xe6, 0xbf, 0x12, 0xf9, 0x6d, 0x01, 0xf8, 0x38, 0xfe, 0xd6, 0x68, 800 0xf1, 0x14, 0x56, 0xc2, 0xe9, 0xd8, 0xa4, 0xa3, 0x4c, 0x8d, 0xfb, 0x39, 0xa9, 0x8e, 0x59, 0x34, 801 0xce, 0x50, 0xb9, 0x8a, 0x7c, 0xe0, 0xa0, 0x94, 0x60, 0x6e, 0x8d, 0x26, 0xd9, 0x0d, 0x5e, 0xbc, 802 0xbe, 0xc1, 0xf3, 0x68, 0x2a, 0xaf, 0x38, 0xb8, 0x6b, 0xd1, 0xf1, 0xcd, 0x7b, 0x2a, 0x7f, 0x2d, 803 0x12, 0xd2, 0xe2, 0xe7, 0x87, 0xc6, 0xbd, 0xec, 0xa4, 0x28, 0x87, 0xc6, 0x77, 0x98, 0x4c, 0x03, 804 0xa7, 0xe9, 0x10, 0x8f, 0x3d, 0x4e, 0x9a, 0xc9, 0x5f, 0x86, 0xef, 0x86, 0xdf, 0x78, 0xcd, 0xec, 805 0x26, 0x8e, 0xcf, 0x1c, 0x67, 0x96, 0x18, 0x64, 0xfb, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb1, 806 0xa1, 0x02, 0xbb, 0x71, 0x09, 0x00, 0x00, 807} 808