Skip to content

Commit

Permalink
refactor(capture-sdk): Rename ocr package to textrecognition
Browse files Browse the repository at this point in the history
PIA-4354
  • Loading branch information
a-szotyori committed Sep 14, 2023
1 parent 48c1a06 commit 0965990
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
import net.gini.android.capture.internal.network.AnalysisNetworkRequestResult;
import net.gini.android.capture.internal.network.FailureException;
import net.gini.android.capture.internal.network.NetworkRequestsManager;
import net.gini.android.capture.internal.ocr.IBANFilter;
import net.gini.android.capture.internal.ocr.OCR;
import net.gini.android.capture.internal.ocr.OCRText;
import net.gini.android.capture.internal.ocr.OCRView;
import net.gini.android.capture.internal.textrecognition.IBANFilter;
import net.gini.android.capture.internal.textrecognition.OCR;
import net.gini.android.capture.internal.textrecognition.OCRText;
import net.gini.android.capture.internal.textrecognition.OCRView;
import net.gini.android.capture.internal.qrcode.PaymentQRCodeData;
import net.gini.android.capture.internal.qrcode.PaymentQRCodeReader;
import net.gini.android.capture.internal.qrcode.QRCodeDetectorTask;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.gini.android.capture.internal.ocr
package net.gini.android.capture.internal.textrecognition

import android.graphics.Rect
import android.util.Log
Expand All @@ -13,7 +13,7 @@ class IBANFilter {

private val ibanValidator: IBANValidator = IBANValidator()

private val ibanRegex = """[A-Z]{2}\d{2}.*\d""".toRegex()
private val ibanRegex = Regex("[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}")

fun process(text: OCRText): OCRText {
return OCRText(text.elements.map { element ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.gini.android.capture.internal.ocr
package net.gini.android.capture.internal.textrecognition

import android.graphics.Rect
import android.media.Image
Expand All @@ -7,11 +7,8 @@ import com.google.mlkit.vision.common.InputImage
import com.google.mlkit.vision.text.Text
import com.google.mlkit.vision.text.TextRecognition
import com.google.mlkit.vision.text.latin.TextRecognizerOptions
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.util.concurrent.Executors

/**
* Created by Alpár Szotyori on 27.04.23.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.gini.android.capture.internal.ocr
package net.gini.android.capture.internal.textrecognition

import android.graphics.Point
import android.graphics.Rect

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package net.gini.android.capture.internal.ocr
package net.gini.android.capture.internal.textrecognition

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
import android.graphics.Rect
import android.util.AttributeSet
import android.util.Log
import android.view.View
import net.gini.android.capture.internal.util.Size

Expand Down

0 comments on commit 0965990

Please sign in to comment.