You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

792 lines
30 KiB

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