Initial commit
This commit is contained in:
commit
6072b2ba29
844 changed files with 220532 additions and 0 deletions
34
app/src/main/java/com/aryan/reader/pdf/OcrModels.kt
Normal file
34
app/src/main/java/com/aryan/reader/pdf/OcrModels.kt
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package com.aryan.reader.pdf.ocr
|
||||
|
||||
import android.graphics.Rect
|
||||
|
||||
/**
|
||||
* Platform-agnostic OCR result models to decouple the app from Google ML Kit.
|
||||
*/
|
||||
data class OcrResult(
|
||||
val text: String,
|
||||
val textBlocks: List<OcrBlock>
|
||||
)
|
||||
|
||||
data class OcrBlock(
|
||||
val text: String,
|
||||
val boundingBox: Rect?,
|
||||
val lines: List<OcrLine>
|
||||
)
|
||||
|
||||
data class OcrLine(
|
||||
val text: String,
|
||||
val boundingBox: Rect?,
|
||||
val elements: List<OcrElement>
|
||||
)
|
||||
|
||||
data class OcrElement(
|
||||
val text: String,
|
||||
val boundingBox: Rect?,
|
||||
val symbols: List<OcrSymbol>
|
||||
)
|
||||
|
||||
data class OcrSymbol(
|
||||
val text: String,
|
||||
val boundingBox: Rect?
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue