Exemplo n.º 1
0
 public TheProjectsController(ChatBotContext ctx, ILogger <TheProjectsController> logger, IPatternsRepository patternRepo, IMapper mapper)
 {
     _dbContext   = ctx;
     _logger      = logger;
     _patternRepo = patternRepo;
     _mapper      = mapper;
 }
Exemplo n.º 2
0
 public ContextWrappersController(ChatBotContext ctx, ILogger <ContextWrappersController> logger,
                                  IPatternsRepository patternRepo, IMapper mapper, IValidationHelperRepository validationRepo)
 {
     _dbContext      = ctx;
     _logger         = logger;
     _patternRepo    = patternRepo;
     _mapper         = mapper;
     _validationRepo = validationRepo;
 }
Exemplo n.º 3
0
        public Workflow(SourceRepository sourceRepository      = null,
                        IPatternsRepository patternsRepository = null, Stage stage = Stage.Match)
            : base(stage)
        {
            LogsDir            = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "PT.PM");
            DumpDir            = LogsDir;
            TempDir            = Path.Combine(Path.GetTempPath(), "PT.PM");
            SourceRepository   = sourceRepository;
            PatternsRepository = patternsRepository ?? new DefaultPatternRepository();
            IPatternSerializer jsonNodeSerializer = new JsonPatternSerializer();
            IPatternSerializer dslNodeSerializer  = new DslProcessor();

            PatternConverter = new PatternConverter(jsonNodeSerializer, dslNodeSerializer);
            Stage            = stage;
        }
Exemplo n.º 4
0
        public Workflow(ISourceCodeRepository sourceCodeRepository, LanguageFlags languages,
                        IPatternsRepository patternsRepository = null, Stage stage = Stage.Match)
            : base(stage)
        {
            SourceCodeRepository = sourceCodeRepository;
            PatternsRepository   = patternsRepository ?? new DefaultPatternRepository();
            ParserConverterSets  = ParserConverterBuilder.GetParserConverterSets(languages);
            UstPatternMatcher    = new BruteForcePatternMatcher();
            IUstNodeSerializer jsonNodeSerializer = new JsonUstNodeSerializer(typeof(UstNode), typeof(PatternVarDef));
            IUstNodeSerializer dslNodeSerializer  = new DslProcessor();

            PatternConverter = new PatternConverter(new IUstNodeSerializer[] { jsonNodeSerializer, dslNodeSerializer });
            Stage            = stage;
            ThreadCount      = 1;
        }
Exemplo n.º 5
0
 public void Init()
 {
     patternsRepository = new DefaultPatternRepository();
 }
Exemplo n.º 6
0
 public static void AssemblyInitalize()
 {
     PatternsRepository = new DefaultPatternRepository();
 }
Exemplo n.º 7
0
 private IList <Pattern> ListPatterns(IPatternsRepository patternRepository)
 {
     return(patternRepository.GetPatterns().ToList());
 }
Exemplo n.º 8
0
 public Workflow(ISourceCodeRepository sourceCodeRepository,
                 IPatternsRepository patternsRepository = null, Stage stage = Stage.Match)
     : this(sourceCodeRepository, LanguageExt.AllLanguages, patternsRepository, stage)
 {
 }
Exemplo n.º 9
0
 public Workflow(ISourceCodeRepository sourceCodeRepository, Language language,
                 IPatternsRepository patternsRepository = null, Stage stage = Stage.Match)
     : this(sourceCodeRepository, language.ToFlags(), patternsRepository, stage)
 {
 }
Exemplo n.º 10
0
 private IList<Pattern> ListPatterns(IPatternsRepository patternRepository)
 {
     return patternRepository.GetPatterns().ToList();
 }