複製
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"description": "文件。",
"definitions": {
"borderType": {
"type": "string",
"description": "表格儲存格邊框類型。",
"enum": [
"unknown",
"invisible",
"visible"
]
},
"rect": {
"type": "object",
"description": "矩形 {r:left, t:top, r:right, b:bottom}",
"required": [
"l",
"t",
"r",
"b"
],
"properties": {
"l": {
"type": "integer",
"description": "左側座標。"
},
"t": {
"type": "integer",
"description": "頂部座標。"
},
"r": {
"type": "integer",
"description": "右側座標。"
},
"b": {
"type": "integer",
"description": "底部座標。"
}
}
},
"confidence": {
"type": "number",
"description": "信賴度。"
},
"listNumberingStyle": {
"type": "string",
"description": "清單編號樣式。",
"enum": [
"None",
"Decimal",
"UpperRoman",
"LowerRoman",
"UpperLetter",
"LowerLetter",
"Ordinal",
"CardinalText",
"OrdinalText",
"Hex",
"Chicago",
"IdeographDigital",
"JapaneseCounting",
"Aiueo",
"Iroha",
"DecimalFullWidth",
"DecimalHalfWidth",
"JapaneseLegal",
"JapaneseDigitalTenThousand",
"DecimalEnclosedCircle",
"DecimalFullWidth2",
"AiueoFullWidth",
"IrohaFullWidth",
"DecimalZero",
"Bullet",
"Ganada",
"Chosung",
"DecimalEnclosedFullstop",
"DecimalEnclosedParen",
"DecimalEnclosedCircleChinese",
"IdeographEnclosedCircle",
"IdeographTraditional",
"IdeographZodiac",
"IdeographZodiacTraditional",
"TaiwaneseCounting",
"IdeographLegalTraditional",
"TaiwaneseCountingThousand",
"TaiwaneseDigital",
"ChineseCounting",
"ChineseLegalSimplified",
"ChineseCountingThousand",
"ApplicationDefined",
"KoreanDigital",
"KoreanCounting",
"KoreanLegal",
"KoreanDigital2",
"Hebrew1",
"ArabicAlpha",
"Hebrew2",
"ArabicAbjad",
"HindiVowels",
"HindiConsonants",
"HindiNumbers",
"HindiCounting",
"ThaiLetters",
"ThaiNumbers",
"ThaiCounting",
"VietnameseCounting",
"NumberInDash",
"RussianLower",
"RussianUpper",
"Burmese",
"Unnumbered"
]
},
"listLevel": {
"type": "object",
"description": "清單層級描述",
"required": [
"levelIndex",
"numberingStyle",
"startNumber"
],
"properties": {
"levelIndex": {
"type": "integer",
"description": "層級索引。",
"minimum": 0
},
"numberingStyle": {
"$ref": "#/definitions/listNumberingStyle",
"description": "List numbering style."
},
"startNumber": {
"type": "integer",
"description": "起始編號。"
}
}
},
"picture": {
"type": "object",
"description": "包含影像的區塊。",
"properties": {
"id": {
"type": "string",
"description": "圖片區塊 ID。"
},
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
}
}
},
"barcode": {
"type": "object",
"description": "條碼。",
"properties": {
"id": {
"type": "string",
"description": "條碼區塊 ID。"
},
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"type": {
"type": "string",
"description": "條碼類型。",
"enum": [
"Code39",
"Interleaved25",
"EAN13",
"Code128",
"EAN8",
"PDF417",
"Codabar",
"UPCE",
"Industrial25",
"IATA25",
"Matrix25",
"Code93",
"PostNet",
"UCC128",
"Patch",
"Aztec",
"DataMatrix",
"QRCode",
"UPCA",
"MaxiCode",
"Code32",
"FullAscii",
"IntelligentMail",
"RoyalMail4State",
"KIX",
"Australia4State",
"JapanPost",
"NotFound"
]
},
"value": {
"type": "string",
"description": "條碼值。"
},
"supplementType": {
"type": "string",
"description": "補充類型。",
"enum": [
"none",
"2digits",
"5digits"
]
},
"supplementValue": {
"type": "string",
"description": "補充值。"
}
}
},
"lines": {
"type": "array",
"description": "文字區塊中按閱讀方向排序的文字字串陣列。",
"items": [
{
"type": "object",
"description": "一行文字。",
"properties": {
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"text": {
"type": "string",
"description": "文字行的值。"
},
"charParams": {
"$ref": "#/definitions/charParams"
},
"words": {
"type": "array",
"description": "文字行中按閱讀方向排序的單字陣列。",
"items": [
{
"type": "object",
"description": "單字。",
"properties": {
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"text": {
"type": "string",
"description": "單字值。"
},
"charParams": {
"$ref": "#/definitions/charParams"
},
"chars": {
"type": "array",
"description": "單字中按閱讀方向排序的字元陣列。",
"items": [
{
"type": "object",
"description": "單字字元。",
"properties": {
"confidence": {
"$ref": "#/definitions/confidence"
},
"text": {
"type": "string",
"description": "單字字元值。"
},
"position": {
"$ref": "#/definitions/rect"
},
"charParams": {
"$ref": "#/definitions/charParams"
}
}
}
]
}
}
}
]
}
}
}
]
},
"charParams": {
"type": "object",
"description": "符號字型格式化參數。",
"properties": {
"bold": {
"type": "boolean",
"description": "粗體屬性狀態 - 如果與容器的狀態不同",
"default": false
},
"italic": {
"type": "boolean",
"description": "Italic property state - if it is different from the container's one",
"default": false
},
"underlined": {
"type": "boolean",
"description": "Underlined property state - if it is different from the container's one",
"default": false
},
"strikeout": {
"type": "boolean",
"description": "Strikeout property state - if it is different from the container's one",
"default": false
},
"smallCaps": {
"type": "boolean",
"description": "SmallCaps property state - if it is different from the container's one",
"default": false
},
"superscript": {
"type": "boolean",
"description": "Superscript property state - if it is different from the container's one",
"default": false
},
"subscript": {
"type": "boolean",
"description": "Subscript property state - if it is different from the container's one",
"default": false
},
"scaling": {
"type": "integer",
"description": "Scaling property state (in thousandths of 1) - if it is different from the container's one",
"default": 1000,
"minimum": 100,
"maximum": 10000
},
"spacing": {
"type": "integer",
"description": "Spacing property state in twips (1/20 pt, 1/1440 inch) - if it is different from the container's one",
"default": 0,
"minimum": -1000,
"maximum": 1000
},
"fontSize": {
"type": "integer",
"description": "Font size property state in twips (1/20 pt, 1/1440 inch) - if it is different from the container's one",
"default": 200,
"minimum": 50,
"maximum": 4000
},
"fontName": {
"type": "string",
"description": "Font name property state - if it is different from the container's one"
},
"color": {
"type": "string",
"description": "Symbol font color property state (hexadecimal value in 6-digits format RRGGBB) - if it is different from the container's one"
},
"backgroundColor": {
"type": "string",
"description": "Symbol background color property state (hexadecimal value in 6-digits format RRGGBB) - if it is different from the container's one"
},
"lang": {
"type": "string",
"description": "符號語言屬性狀態(由語言和國家/地區部分組成,請參閱 ISO 639 和 ISO 3166)- 若與容器的狀態不同"
}
}
}
},
"required": [
"version",
"producer"
],
"properties": {
"version": {
"type": "string",
"description": "Document schema version.",
"default": "Vantage OCR.Skill JSON output v1.0"
},
"producer": {
"type": "string",
"description": "JSON file author.",
"default": "ABBYY Vantage OCR.Skill"
},
"languages": {
"type": "array",
"description": "List of document languages.",
"items": [
{
"type": "string",
"description": "Document language."
}
]
},
"layout": {
"type": "object",
"description": "Layout (physical structure).",
"required": [
"pages"
],
"properties": {
"corrected": {
"type": "boolean",
"description": "Coordinates for the corrected image on the output.",
"default": true
},
"pages": {
"type": "array",
"description": "Array of document pages ordered from first to last.",
"items": [
{
"type": "object",
"description": "Document page.",
"properties": {
"width": {
"type": "integer",
"description": "The width of the page in pixels."
},
"height": {
"type": "integer",
"description": "The height of the page in points."
},
"rotated": {
"type": "string",
"description": "Rotation of the page relative to the original image.",
"enum": [
"none",
"clockwise",
"counterclockwise",
"upside-down"
]
},
"texts": {
"type": "array",
"description": "An array of blocks with text.",
"items": [
{
"type": "object",
"description": "Text.",
"properties": {
"id" : {
"type": "string",
"description": "Text block ID."
},
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"lines": {
"#ref": "#/definitions/lines"
}
}
}
]
},
"tables": {
"type": "array",
"description": "An array of blocks with a table.",
"items": [
{
"type": "object",
"description": "Table.",
"properties": {
"id" : {
"type": "string",
"description": "Table block ID."
},
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"cells": {
"type": "array",
"description": "Table cells.",
"items": [
{
"type": "object",
"description": "Table cell.",
"properties": {
"id" : {
"type": "string",
"description": "Table cell ID."
},
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"colRowPosition": {
"type": "object",
"description": "Cell coordinate in the Column-Row system {l:leftColumn, t:topRow, r:rightColumn, b:bottomRow}",
"properties":{
"l": {
"type": "integer",
"description": "Left separator index."
},
"t": {
"type": "integer",
"description": "Top separator index."
},
"r": {
"type": "integer",
"description": "Right separator index."
},
"b": {
"type": "integer",
"description": "Bottom separator index."
}
}
},
"borders": {
"type": "object",
"description": "Table cell border types {l:left, t:top, r:right, b:bottom}",
"properties":{
"l": {
"$ref": "#/definitions/borderType",
"description": "Left border type."
},
"t": {
"$ref": "#/definitions/borderType",
"description": "Top border type."
},
"r": {
"$ref": "#/definitions/borderType",
"description": "Right border type."
},
"b": {
"$ref": "#/definitions/borderType",
"description": "Bottom border type."
}
}
},
"contentType": {
"type": "string",
"description": "Table cell content type: [text, picture, barcode].",
"enum": [
"text",
"picture",
"barcode"
]
},
"picture": {
"$ref": "#/definitions/picture"
},
"barcode": {
"$ref": "#/definitions/barcode"
},
"lines": {
"$ref": "#/definitions/lines"
}
}
}
]
}
}
}
]
},
"pictures": {
"type": "array",
"description": "包含圖片的區塊陣列。",
"items": [
{
"$ref": "#/definitions/picture"
}
]
},
"barcodes": {
"type": "array",
"description": "包含條碼的區塊陣列。",
"items": [
{
"$ref": "#/definitions/barcode"
}
]
},
"separators": {
"type": "array",
"description": "包含分隔符的區塊陣列。",
"items": [
{
"type": "object",
"description": "分隔符。",
"properties": {
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"color": {
"type": "integer",
"description": "分隔符顏色。"
},
"thickness": {
"type": "integer",
"description": "分隔符粗細。"
},
"type": {
"type": "string",
"description": "分隔符類型。",
"enum": [
"unknown",
"solid",
"dotted"
]
},
"endPoints": {
"type": "object",
"description": "分隔符端點的座標 {startX:startX, startY:startY, endX:endX, endY:endY}",
"properties":{
"startX": {
"type": "integer",
"description": "起點 X 座標。"
},
"startY": {
"type": "integer",
"description": "起點 Y 座標。"
},
"endX": {
"type": "integer",
"description": "終點 X 座標。"
},
"endY": {
"type": "integer",
"description": "終點 Y 座標。"
}
}
}
}
}
]
},
"checkmarks": {
"type": "array",
"description": "包含核取記號的區塊陣列。",
"items": [
{
"type": "object",
"description": "核取記號。",
"properties": {
"position": {
"$ref": "#/definitions/rect"
},
"confidence": {
"$ref": "#/definitions/confidence"
},
"value": {
"type": "string",
"description": "核取記號值。",
"enum": [
"checked",
"unchecked",
"corrected",
"unknown"
]
}
}
}
]
}
}
}
]
}
}
},
"content": {
"type": "object",
"description": "文件內容(邏輯結構)。",
"properties": {
"paragraphs": {
"type": "array",
"description": "按閱讀方向排序的文件段落陣列。",
"items": [
{
"type": "object",
"description": "文件段落。",
"properties": {
"id": {
"type": "string",
"description": "文件中的段落 ID。"
},
"role": {
"type": "string",
"description": "段落在文件中的角色。",
"enum": [
"other",
"text",
"heading",
"headingNumber",
"tableOfContents",
"tableText",
"runningTitle",
"endNote",
"footNote",
"tableCaption",
"tableHeading",
"pictureCaption",
"artefact"
]
},
"formatting": {
"type": "object",
"description": "段落格式。",
"properties": {
"aligning": {
"type": "string",
"description": "段落中的文字對齊方式。",
"enum": [
"left",
"center",
"right",
"justified",
"justifiedForArabic"
]
},
"lineSpacing": {
"type": "integer",
"description": "段落行距。",
"minimum": 0,
"default": 0
}
}
},
"layoutReferences": {
"type": "array",
"description": "頁面區塊結構中文件段落部分來源的陣列,按段落中文字的順序排列。",
"items": [
{
"type": "object",
"description": "參考區塊/儲存格 ID、段落索引以及區塊/儲存格中的行範圍。",
"required": [
"blockId",
"blockType",
"parIndex",
"firstLine",
"lastLine"
],
"properties": {
"blockId": {
"type": "string",
"description": "包含的文字區塊或表格儲存格 ID。"
},
"blockType": {
"type": "string",
"description": "段落容器類型。",
"enum": [
"text",
"cell"
]
},
"sectionIndex": {
"type": "integer",
"description": "頁面上邏輯區段的索引(如果沒有包含該段落的區段,例如頁首、頁尾等,則為 -1)。",
"minimum": -1
},
"columnIndex": {
"type": "integer",
"description": "邏輯區段中欄的索引(如果沒有包含該段落的欄,例如插入文字、註腳等,則為 -1)。",
"minimum": -1
},
"lineNumbering": {
"type": "boolean",
"description": "如果段落包含在行編號區域中,則為 true。"
},
"parIndex": {
"type": "integer",
"description": "區塊或表格儲存格中的段落索引。",
"minimum": 0
},
"firstLine": {
"type": "integer",
"description": "區塊或表格儲存格中段落第一行的索引。",
"minimum": 0
},
"lastLine": {
"type": "integer",
"description": "區塊或表格儲存格中段落最後一行的索引。",
"minimum": 0
}
}
}
]
},
"text": {
"type": "string",
"description": "段落文字。"
},
"listReference": {
"type": "object",
"description": "包含該段落的清單參考。",
"properties": {
"id": {
"type": "string",
"description": "清單 ID。"
},
"levelIndex": {
"type": "integer",
"description": "目前清單項目層級索引。",
"minimum": 0,
"default": 0
},
"ordinalNumber": {
"type": "integer",
"description": "目前清單項目序號。",
"minimum": -1,
"default": 0
}
}
},
}
}
]
},
"lists": {
"type": "array",
"description": "文件中找到的清單陣列。",
"items": [
{
"type": "object",
"description": "清單描述。",
"properties": {
"id": {
"type": "string",
"description": "文件中的清單 ID。"
},
"listLevels": {
"type": "array",
"description": "清單層級描述的陣列。",
"items": [
{
"$ref": "#/definitions/listLevel"
}
]
}
}
}
]
}
}
}
}
}```
