Beispiel #1
0
        private static IRecognitionStep getStep(string name)
        {
            Console.WriteLine("Loading stage: " + name);
            switch (name)
            {
            case "cls": return(RecognitionPipeline.createDefaultClassifier());

            case "grp": return(RecognitionPipeline.createDefaultGrouper());

            case "rec": return(RecognitionPipeline.createDefaultRecognizer());

            case "con": return(RecognitionPipeline.createDefaultConnector());

            case "ref": return(RecognitionPipeline.createDefaultRefiner());

            case "ref_ctx": return(new ContextRefiner(ContextDomain.CircuitDomain.GetInstance(), RecognitionPipeline.createDefaultRecognizer()));

            case "ref_cctx": return(new CarefulContextRefiner(ContextDomain.CircuitDomain.GetInstance(), RecognitionPipeline.createDefaultRecognizer()));

            case "ref_steal": return(new StrokeStealRefiner(RecognitionPipeline.createDefaultRecognizer(), RecognitionPipeline.createDefaultConnector()));

            case "ref_shed": return(new StrokeShedRefiner(RecognitionPipeline.createDefaultRecognizer(), RecognitionPipeline.createDefaultConnector()));

            case "ref_search":
                var producer = new CircuitSketchModificationProducer(
                    RecognitionPipeline.createDefaultClassifier(),
                    RecognitionPipeline.createDefaultGateRecognizer(),
                    RecognitionPipeline.createDefaultConnector());
                return(new SearchRefiner(producer));
            }
            TestRig.ExitWithError("No step exists called '" + name + "'! Valid steps are: cls, grp, rec, con, ref, ref_ctx, ref_cctx, ref_steal, ref_shed, ref_search");
            return(null);
        }