· 6 years ago · Mar 11, 2020, 04:34 AM
1ocr #OCR output
2unifiedResultParams #JSON fetched from central config
3expectedDocumentSide #This is an input to OCR API
4channel = ""
5details = String[] #This array will contain details about Orange channel or error for red channel
6
7
8for key,value in unifiedResultParams:
9
10 switch key: {
11
12 case "document_side":
13 if expectedDocumentSide != "front" && ocr.result.documentType.contains("front"):
14 channel = unifiedResultsParams["document_side"]
15 details.append("document side")
16
17 case "black_and_white":
18 if ocr.results.fraudCheck(“isBlackAndWhite”) == “yes”::
19 channel = unifiedResultsParams["“black_and_white”"]
20 details.append("black and white National ID")
21 }
22
23 if “channel” == “red”:
24 break;
25}
26
27if channel = "":
28 channel = "green"