Package-level declarations

Types

Link copied to clipboard
data class Error(val code: Int, val message: String, val info: Map<String, Any>?)
Link copied to clipboard
data class ExtractDocument(val type: String?, val typeConfidence: Double?, val boundingBox: List<Double>?, val extractorId: String, val metaData: ExtractDocumentMetaData, rawData: HashMap<String, JsonElement>, rawDetailedData: HashMap<String, List<JsonObject>>) : ExtractDocumentResult

ExtractDocument contains single document result returned by the FormXAPIClient.extract

Link copied to clipboard
data class ExtractDocumentError(val extractorId: String?, val metaData: ExtractDocumentMetaData, val error: Error) : ExtractDocumentResult

ExtractDocumentError contains error info for parsing document

Link copied to clipboard
data class ExtractDocumentMetaData(val pageNo: List<Int>, val sliceNo: Int, val extractorType: String?)

ExtractDocumentMetaData contains document meta data returned by the FormXAPIClient.extract

Link copied to clipboard
Link copied to clipboard
data class ExtractMetaData(val extractorId: String, val requestId: String, val usage: Int, val jobId: String?)

ExtractMetaData contains api meta data returned by the FormXAPIClient.extract

Link copied to clipboard
class FormXAPIClient(accessToken: String, apiHost: String? = null)

FormXAPIClient is a network client to communicate with the FormX API

Link copied to clipboard
Link copied to clipboard
data class FormXAPIDocument(val bbox: List<Int>, val type: String)

FormXAPIDocument contains a detected document region

Link copied to clipboard

FormXAPIExtractErrorException is a exception class threw when calling FormXAPIClient.extract with error

Link copied to clipboard
data class FormXAPIExtractErrorField(val code: Int, val message: String)

FormXAPIExtractErrorField contains an error of FormXAPIClient.extract

Link copied to clipboard

FormXAPIExtractErrorResponse contains the error response return by FormXAPIClient.extract API.

Link copied to clipboard
data class FormXAPIExtractResponse(val status: String = "", val metaData: ExtractMetaData, val documents: List<ExtractDocumentResult>)

FormXAPIExtractResponse contains the response from FormXAPIClient.extract API.

Link copied to clipboard
data class FormXDataBoolListValue(val detailedData: JsonObject, val value: List<Boolean>) : FormXDataValue
Link copied to clipboard
data class FormXDataBoolValue(val detailedData: JsonObject, val value: Boolean) : FormXDataValue
Link copied to clipboard
data class FormXDataMapListValue(val detailedData: JsonObject, val value: List<Map<String, Any?>>) : FormXDataValue
Link copied to clipboard
data class FormXDataMapValue(val detailedData: JsonObject, val value: Map<String, Any?>) : FormXDataValue
Link copied to clipboard
data class FormXDataNumListValue(val detailedData: JsonObject, val value: List<Number>) : FormXDataValue
Link copied to clipboard
data class FormXDataNumValue(val detailedData: JsonObject, val value: Number) : FormXDataValue
Link copied to clipboard
data class FormXDataProductListValue(val detailedData: JsonObject, val value: List<FormXProductValue>) : FormXDataValue
Link copied to clipboard
data class FormXDataStringListValue(val detailedData: JsonObject, val value: List<String>) : FormXDataValue
Link copied to clipboard
data class FormXDataStringValue(val detailedData: JsonObject, val value: String) : FormXDataValue
Link copied to clipboard
data class FormXDataUnknownValue(val detailedData: JsonObject, val value: Any) : FormXDataValue
Link copied to clipboard
sealed class FormXDataValue

FormXDataValue is the base class of available extraction value returned by the FormXAPIClient.extract.

Link copied to clipboard
data class FormXDocumentRegion(val topLeft: FormXPointF, val topRight: FormXPointF, val bottomRight: FormXPointF, val bottomLeft: FormXPointF, val boundingBox: FormXRectF)

FormXDocumentRegion represents a region in the document.

Link copied to clipboard

A filter to filter out invalid FormXDocumentRegion

Link copied to clipboard

Filter out FormXDocumentRegion with size smaller than the threshold

Link copied to clipboard
data class FormXLetterbox(val sourceWidth: Int = 0, val sourceHeight: Int = 0, val targetWidth: Int = 0, val targetHeight: Int = 0, val scale: Float = 0.0f, val offsetX: Int = 0, val offsetY: Int = 0, val scaledWidth: Int = 0, val scaledHeight: Int = 0)

FormXLetterbox contains the information of how to letterbox a source image to a target image

Link copied to clipboard
data class FormXPointF(val x: Float, val y: Float)

FormXPointF is a point in the coordinate system of the image

Link copied to clipboard
data class FormXProductValue(val amount: Double?, val discount: String?, val name: String?, val quantity: Int?, val sku: String?, val unitPrice: Double?)

FormXProductValue contains the purchase information of a receipt

Link copied to clipboard
data class FormXRectF(val x: Float = 0.0f, val y: Float = 0.0f, val width: Float = 0.0f, val height: Float = 0.0f)

FormXRectF is a rectangle class with x, y, width, height

Functions

Link copied to clipboard
fun JsonElement.optional(): JsonElement?
Link copied to clipboard
fun JsonElement.parseAsFormXAny(): Any?

Properties

Link copied to clipboard
const val BLUR_DETECTOR_THREAD: Int = 12
Link copied to clipboard
const val FORMX_VERTIX_ID: Int = 0
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val REGION_SIZE_THRESHOLD: Double = 0.1
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val REST_API_READ_TIMEOUT: Long = 30
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard