Exemplo n.º 1
0
 public TechnicalCertificateImageProcesser(ITechnicalCertificateService technicalCertificateService,
                                           IWordMatcher wordMatcher,
                                           IWordFinder typeFinder,
                                           IWordFinder markAndModelFinder,
                                           IWordFinder chassisNumFinder,
                                           IWordFinder bodyCodeFinder,
                                           IWordFinder colorFinder,
                                           IWordFinder matriculNumFinder,
                                           IWordFinder firstRegistrationDateFinder,
                                           IWordFinder receptionNumFinder,
                                           IWordFinder soNumFinder,
                                           ITechnicalCertificateValidatior validator)
 {
     this.technicalCertificateService = technicalCertificateService;
     this.wordMatcher                 = wordMatcher;
     this.typeFinder                  = typeFinder;
     this.markAndModelFinder          = markAndModelFinder;
     this.chassisNumFinder            = chassisNumFinder;
     this.bodyCodeFinder              = bodyCodeFinder;
     this.colorFinder                 = colorFinder;
     this.matriculNumFinder           = matriculNumFinder;
     this.firstRegistrationDateFinder = firstRegistrationDateFinder;
     this.receptionNumFinder          = receptionNumFinder;
     this.soNumFinder                 = soNumFinder;
     this.validator = validator;
 }
 public TechnicalCertificateImageProcesser(TextAnnotation textAnnotation,
                                           ITechnicalCertificateService technicalCertificateService,
                                           ITechnicalCertificateValidatior validator,
                                           IList <WordLabel> typeLabels,
                                           IList <WordLabel> markAndModelLabels,
                                           IList <WordLabel> chassisNumLabels,
                                           IList <WordLabel> bodyLabels,
                                           IList <WordLabel> colorLabels,
                                           IList <WordLabel> matriculNumLabels,
                                           IList <WordLabel> firstRegistrationDateLabels,
                                           IList <WordLabel> receptionNumLabels,
                                           IList <WordLabel> soNumLabels)
 {
     this.annotationContext           = textAnnotation;
     this.technicalCertificateService = technicalCertificateService;
     this.validator                   = validator;
     this.typeLabels                  = typeLabels;
     this.markAndModelLabels          = markAndModelLabels;
     this.chassisNumLabels            = chassisNumLabels;
     this.bodyLabels                  = bodyLabels;
     this.colorLabels                 = colorLabels;
     this.matriculNumLabels           = matriculNumLabels;
     this.firstRegistrationDateLabels = firstRegistrationDateLabels;
     this.receptionNumLabels          = receptionNumLabels;
     this.soNumLabels                 = soNumLabels;
 }
        public TechnicalCertificateImageProcesser(TextAnnotation textAnnotation)
        {
            this.annotationContext           = textAnnotation;
            this.technicalCertificateService = new TechnicalCertificateService(textAnnotation);
            this.validator = new TechnicalCertificateValidatior();

            // "Art", "Fahrzeugs", "Genre", "véhicule", "Genere", "veicolo", "Gener", "vehichel"
            this.typeLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L2, Type = LabelTypes.Label_1_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L3, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L4, Type = LabelTypes.Label_2_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L5, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L6, Type = LabelTypes.Label_3_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L7, Type = LabelTypes.Label_4_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.TYPE_CODE_L8, Type = LabelTypes.Label_4_2
                }
            };

            //"Marke", "Typ", "Marque", "type", "Marca", "tipo", "Marca", "tip" - Now using this one!!!
            //or
            //"Marke", "und", "Typ", "Marque", "type", "Marca", "tipo", "Marca", "tip"
            this.markAndModelLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L2, Type = LabelTypes.Label_1_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L3, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L4, Type = LabelTypes.Label_2_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L5, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L6, Type = LabelTypes.Label_3_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L7, Type = LabelTypes.Label_4_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARK_AND_MODEL_L8, Type = LabelTypes.Label_4_2
                }
            };

            //"Fahrgestell", "Nr.", "Chassis", "Telaio", "Schassis", "nr."
            this.chassisNumLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.CHASSIS_NUM_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.CHASSIS_NUM_L2, Type = LabelTypes.Label_1_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.CHASSIS_NUM_L3, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.CHASSIS_NUM_L4, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.CHASSIS_NUM_L5, Type = LabelTypes.Label_4_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.CHASSIS_NUM_L6, Type = LabelTypes.Label_4_2
                }
            };

            //"Karosserie", "Carrosserie", "Carrozzeria", "Carossaria"
            this.bodyLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.BODY_CODE_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.BODY_CODE_L2, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.BODY_CODE_L3, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.BODY_CODE_L4, Type = LabelTypes.Label_4_1
                }
            };

            //"Farbe", "Couleur", "Colore", "Colur"
            this.colorLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.COLOR_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.COLOR_L2, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.COLOR_L3, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.COLOR_L4, Type = LabelTypes.Label_4_1
                }
            };

            //"Stammnummer", "matricule", "matricola", "matricla"
            this.matriculNumLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.MARTICULE_NUM_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARTICULE_NUM_L2, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARTICULE_NUM_L3, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.MARTICULE_NUM_L4, Type = LabelTypes.Label_4_1
                }
            };

            //"Inverkehrsetzung", "mise", "circulation", "messa", "circolazione", "entrada", "circulaziun"
            this.firstRegistrationDateLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.FIRST_REGISTRATION_DATE_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.FIRST_REGISTRATION_DATE_L2, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.FIRST_REGISTRATION_DATE_L3, Type = LabelTypes.Label_2_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.FIRST_REGISTRATION_DATE_L4, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.FIRST_REGISTRATION_DATE_L5, Type = LabelTypes.Label_3_2
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.FIRST_REGISTRATION_DATE_L6, Type = LabelTypes.Label_4_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.FIRST_REGISTRATION_DATE_L7, Type = LabelTypes.Label_4_2
                }
            };

            //"Typengenehmigung", "Reception", "Approvazione", "Approvaziun"
            this.receptionNumLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.RECEPTION_NUM_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.RECEPTION_NUM_L2, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.RECEPTION_NUM_L3, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.RECEPTION_NUM_L4, Type = LabelTypes.Label_4_1
                }
            };

            //"Schild", "Plaque", "Targa", "Numer"
            this.soNumLabels = new List <WordLabel>()
            {
                new WordLabel()
                {
                    Text = WordLabelCodes.SONum_L1, Type = LabelTypes.Label_1_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.SONum_L2, Type = LabelTypes.Label_2_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.SONum_L3, Type = LabelTypes.Label_3_1
                },
                new WordLabel()
                {
                    Text = WordLabelCodes.SONum_L4, Type = LabelTypes.Label_4_1
                }
            };
        }