-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDocumentInstructionsProcessor.cs
46 lines (43 loc) · 1.93 KB
/
DocumentInstructionsProcessor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using Contoso.CognitivePipeline.SharedModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contoso.SB.API.BusinessLogic
{
public class DocumentInstructionsProcessor
{
public static List<string> GetInstructions(ClassificationType docType)
{
List<string> instructions = new List<string>();
switch (docType)
{
//All OCR cases. Note that system currently does not support of these types of documents.
case ClassificationType.ID: //For Contoso Employee ID
case ClassificationType.Passport:
case ClassificationType.DriverLicense:
instructions.Add(InstructionFlag.AnalyzeText.ToString());
//TODO: Testing adding Face Authentication to be part of analyzing ID documents
//instructions.Add(InstructionFlag.FaceAuthentication.ToString());
break;
case ClassificationType.Face: //Used to authenticate face in application sign in
instructions.Add(InstructionFlag.FaceAuthentication.ToString());
break;
case ClassificationType.StoreShelf:
instructions.Add(InstructionFlag.ShelfCompliance.ToString());
break;
case ClassificationType.Generic: //anything else, use Analyze Image service to describe the image
instructions.Add(InstructionFlag.AnalyzeImage.ToString());
break;
case ClassificationType.Unidentified:
instructions.Add(InstructionFlag.AnalyzeImage.ToString());
break;
default:
instructions.Add(InstructionFlag.AnalyzeImage.ToString());
break;
}
return instructions;
}
}
}