Exemplo n.º 1
0
 public MoviesService(IMovieRepositorio MovieRepositorio, 
     IGrammarService  GrammarService
     )
 {
     this.GrammarService = GrammarService; 
     this.MovieRepositorio = MovieRepositorio; 
 }
Exemplo n.º 2
0
 public PartialsController(
     IGrammarService _GrammarService,
     IGrammarCategoryService _GrammarCategoryService)
 {
     this._GrammarService         = _GrammarService;
     this._GrammarCategoryService = _GrammarCategoryService;
 }
Exemplo n.º 3
0
        public void Start(NatSpeakService natSpeakService)
        {
            _natSpeakService = natSpeakService ?? throw new ArgumentNullException(nameof(natSpeakService));

            ShowConsole();

            _logger.Info("Starting...");
            _logger.Info(
                $"Product version: {Assembly.GetExecutingAssembly().GetName().Version}"
                );

            // Get a reference to the GrammarService instance.
            _grammarService = _natSpeakService.GrammarService;
            _grammarService.GrammarSerializer = new GrammarSerializer();

            _logger.Info("Querying Dragon Naturally Speaking...");

            var profileName = _natSpeakService.GetCurrentUserProfileName();
            var profilePath = _natSpeakService.GetUserDirectory(profileName);

            _logger.Info($"Dragon Profile Loaded: {profileName}");
            _logger.Info($"Dragon Profile Path: {profilePath}");

            LoadGrammars();
        }
Exemplo n.º 4
0
 public ArticuloService(IArticuloRepositorio ArticuloRepositorio,
     IGrammarService GrammarService
     )
 {
     this.GrammarService = GrammarService;
     this.ArticuloRepositorio = ArticuloRepositorio;
 }
Exemplo n.º 5
0
 public void Init()
 {
     InternalGrammarService = FerOmegaInjections.InternalGrammarService;
     TokenizationService    = FerOmegaInjections.TokenizationService;
     AstService             = FerOmegaInjections.AstService;
     SqlGrammarService      = FerOmegaInjections.SqlGrammarService;
     SqlProvider            = FerOmegaInjections.SqlProvider;
 }
Exemplo n.º 6
0
        protected Grammar(RuleFactory ruleFactory, IGrammarService grammarService)
        {
            Debug.Assert(ruleFactory != null);
            Debug.Assert(grammarService != null);

            _grammarService = grammarService;
            RuleFactory     = ruleFactory;
        }
Exemplo n.º 7
0
        public async Task Start(NatSpeakService natSpeakService)
        {
            _natSpeakService = natSpeakService ?? throw new ArgumentNullException(nameof(natSpeakService));

            ShowConsole();

            _logger.Info("Starting...");
            _logger.Info(
                $"Mouse Plot version: {Assembly.GetExecutingAssembly().GetName().Version}"
                );

            // Get a reference to the GrammarService instance.
            _grammarService = _natSpeakService.GrammarService;
            _grammarService.GrammarSerializer = new GrammarSerializer();

            _logger.Info("Querying Dragon Naturally Speaking...");

            _logger.Info($"Dragon Version: {_natSpeakService.GetDragonVersion()}");

            String profileName;
            String profilePath;

            for (var notified = false;; notified = true)
            {
                profileName = _natSpeakService.GetCurrentUserProfileName();

                // If a profile name could not be retrieved, then either the user
                // hasn't selected a profile yet, or NatSpeak hasn't been started.
                if (profileName == null)
                {
                    if (notified == false)
                    {
                        _logger.Info("Could not load profile. Will try again.");
                        ShowNotifyInfo("Could not load profile. Will try again.");
                    }

                    // Wait for a bit.
                    await Task.Delay(2000);

                    // Try again...
                    continue;
                }

                // Get the file-system location of the user's profile (for informational purposes).
                profilePath = _natSpeakService.GetUserDirectory(profileName);

                // Profile found.
                break;
            }

            _logger.Info($"Dragon Profile Loaded: {profileName}");
            _logger.Info($"Dragon Profile Path: {profilePath}");

            LoadGrammars();

            CloseConsole();
        }
Exemplo n.º 8
0
 // For Testing
 public MousePlotGrammar(IGrammarService grammarService, IScreen screen,
                         IWindow plotWindow, IZoomWindow zoomWindow, IWindow cellWindow,
                         IWindow markArrowWindow)
     : base(grammarService)
 {
     _currentScreen   = screen;
     _plotWindow      = plotWindow;
     _zoomWindow      = zoomWindow;
     _cellWindow      = cellWindow;
     _markArrowWindow = markArrowWindow;
 }
Exemplo n.º 9
0
 public ExamDataCreateUpdateModel(
     IExamCategoryService examCategoryService,
     ISkillCategoryService skillCategoryService,
     ISkillPartService skillPartService,
     IExamDataLibraryService examDataLibraryService,
     IGrammarService grammarService)
 {
     _ExamCategoryService    = examCategoryService;
     _SkillCategoryService   = skillCategoryService;
     _SkillPartService       = skillPartService;
     _ExamDataLibraryService = examDataLibraryService;
     _GrammarService         = grammarService;
 }
Exemplo n.º 10
0
        protected Grammar(IGrammarService grammarService)
            : this(new RuleFactory(), grammarService)
        {
            // This is a list of the rules themselves (by name)
            _rules     = new Dictionary <String, IRule>(StringComparer.CurrentCultureIgnoreCase);
            _rulesById = new Dictionary <UInt32, IRule>();

            // These are lookups to find the numeric ids for words/rule names
            _wordIds = new Dictionary <String, UInt32>(StringComparer.CurrentCultureIgnoreCase);
            _ruleIds = new Dictionary <String, UInt32>(StringComparer.CurrentCultureIgnoreCase);

            _activeRules = new Dictionary <String, UInt32>();
        }
Exemplo n.º 11
0
        public TwitterBotHostedService(ILogger <TwitterBotHostedService> logger,
                                       IEnumerable <IGrammarService> grammarServices,
                                       ITwitterLogService twitterLogService,
                                       ITwitterClient userClient,
                                       IOptions <TwitterBotSettings> options)
        {
            _logger             = logger;
            _twitterLogService  = twitterLogService;
            _twitterClient      = userClient;
            _twitterBotSettings = options.Value;

            _grammarService = grammarServices.First(v => v.GrammarAlgorith == Defaults.DefaultAlgorithm);
            _grammarService.SetStrictnessLevel(CorrectionStrictnessLevels.Tolerant);
        }
        public TwitterBotHostedService(ILogger <TwitterBotHostedService> logger,
                                       IEnumerable <IGrammarService> grammarServices,
                                       ITwitterLogService twitterLogService,
                                       ITwitterClient userClient,
                                       IOptions <TwitterBotSettings> options,
                                       IGithubService githubService,
                                       IScheduledTweetService scheduledTweetService,
                                       ISentimentAnalysisService sentimentAnalysisService)
            : base(logger, twitterLogService, userClient, options.Value, scheduledTweetService, sentimentAnalysisService)
        {
            _githubService = githubService;

            _grammarService = grammarServices.First(v => v.GrammarAlgorith == Defaults.DefaultAlgorithm);
            _grammarService.SetStrictnessLevel(CorrectionStrictnessLevels.Tolerant);
        }
Exemplo n.º 13
0
 public SqlProvider(IGrammarService <T> sqlGrammarService)
 {
     this.sqlGrammarService = sqlGrammarService;
 }
Exemplo n.º 14
0
 public OperatorService(IGrammarService <IGrammarConfig> grammarService)
 {
     this.grammarService = grammarService;
 }
Exemplo n.º 15
0
 public MousePlotGrammar(IGrammarService grammarService)
     : this(grammarService, new TestableScreen().PrimaryScreen,
            new PlotWindow(), new ZoomWindow(), new CellWindow(),
            new ArrowWindow())
 {
 }
Exemplo n.º 16
0
 public AstService(IGrammarService <IGrammarConfig> grammarService, IOperatorService operatorService)
 {
     this.grammarService  = grammarService;
     this.operatorService = operatorService;
 }
Exemplo n.º 17
0
 public TestGrammar(IGrammarService grammarService)
     : base(grammarService)
 {
 }
Exemplo n.º 18
0
 public TokenizationService(IGrammarService <T> grammarService)
 {
     this.grammarService = grammarService;
 }