Пример #1
0
 public CognitiveLaunchController(
     IVisionService visionService,
     IAutoSuggestService autoSuggestService,
     IImageSearchService imageSearchService,
     ISpellCheckService spellCheckService,
     IWebSearchService webSearchService,
     INewsSearchService newsSearchService,
     IVideoSearchService videoSearchService,
     IVideoService videoService,
     IEmotionService emotionService,
     IFaceService faceService,
     ILinguisticService linguisticService,
     ISentimentService sentimentService,
     IEntityLinkingService entityLinkingService,
     ILanguageService languageService)
 {
     VisionService        = visionService;
     AutoSuggestService   = autoSuggestService;
     ImageSearchService   = imageSearchService;
     SpellCheckService    = spellCheckService;
     WebSearchService     = webSearchService;
     NewsSearchService    = newsSearchService;
     VideoSearchService   = videoSearchService;
     VideoService         = videoService;
     EmotionService       = emotionService;
     FaceService          = faceService;
     LinguisticService    = linguisticService;
     SentimentService     = sentimentService;
     EntityLinkingService = entityLinkingService;
     LanguageService      = languageService;
 }
Пример #2
0
        public QuestionDialog(string dialogId, BotServices services, ISpellCheckService spellCheckService, ISearchService searchService, IEnumerable <WaterfallStep> steps = null) : base(dialogId ?? nameof(QuestionDialog))
        {
            string fullPath = Path.Combine(new string[] { ".", ".", "Resources", "QuestionDialog.lg" });

            _lgEngine = Templates.ParseFile(fullPath);

            _services = services ?? throw new ArgumentNullException(nameof(services));

            if (!_services.LuisServices.ContainsKey(LuisServiceConfiguration.LuisKey))
            {
                throw new ArgumentException($"La configuración no es correcta. Por favor comprueba que existe en tu fichero '.bot' un servicio LUIS llamado '{LuisServiceConfiguration.LuisKey}'.");
            }

            if (!_services.QnAServices.ContainsKey(QnaMakerServiceConfiguration.QnaKey))
            {
                throw new ArgumentException($"La configuración no es correcta. Por favor comprueba que existe en tu fichero '.bot' un servicio Qna llamado '{QnaMakerServiceConfiguration.QnaKey}'.");
            }

            _searchService     = searchService;
            _spellCheckService = spellCheckService;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroQuestionStepAsync,
                CheckIfAnswerIsValidStepAsync,
                RepeatQuestionStepAsync,
                IsValidQuestionStepAsync,
                EndQuestionStepAsync
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
 public ProccessMessageService(IDeviceDataService deviceDataService,
                               ISpellCheckService spellCheckService,
                               ITranslationService translationService)
 {
     _deviceDataService  = deviceDataService;
     _spellCheckService  = spellCheckService;
     _translationService = translationService;
 }
Пример #4
0
 public RootDialog(IDeviceDataService deviceDataService,
                   ISpellCheckService spellCheckService,
                   IMessageBuilderService messageBuilderService)
 {
     _deviceDataService     = deviceDataService;
     _spellCheckService     = spellCheckService;
     _messageBuilderService = messageBuilderService;
 }
Пример #5
0
 public AbstractLuisDialog(IDeviceDataService deviceDataService,
                           ISpellCheckService spellCheckService,
                           IMessageBuilderService messageBuilderService)
 {
     DeviceDataService     = deviceDataService;
     SpellCheckService     = spellCheckService;
     MessageBuilderService = messageBuilderService;
 }
Пример #6
0
        public OleChatController(
            ILuisService luisService,
            ILuisConversationService luisConversationService,
            IWebUtilWrapper webUtil,
            ISitecoreDataWrapper dataWrapper,
            IOleSettings chatSettings,
            ISetupInformationFactory setupFactory,
            ISetupService setupService,
            ISpeechService speechService,
            ISearchService searcher,
            IConversationContextFactory conversationContextFactory,
            ISpellCheckService spellCheckService,
            IIntentProvider intentProvider)
        {
            LuisService             = luisService;
            LuisConversationService = luisConversationService;
            WebUtil       = webUtil;
            DataWrapper   = dataWrapper;
            ChatSettings  = chatSettings;
            SetupFactory  = setupFactory;
            SetupService  = setupService;
            SpeechService = speechService;
            Searcher      = searcher;
            ConversationContextFactory = conversationContextFactory;
            SpellCheckService          = spellCheckService;
            IntentProvider             = intentProvider;
            ThemeManager.GetImage("Office/32x32/man_8.png", 32, 32);

            var lang = WebUtil.GetQueryString("language");

            if (string.IsNullOrWhiteSpace(lang))
            {
                lang = Sitecore.Context.Language.Name;
            }

            var db = WebUtil.GetQueryString("db");

            if (string.IsNullOrWhiteSpace(db))
            {
                db = "master";
            }

            Parameters = new ItemContextParameters()
            {
                Id       = WebUtil.GetQueryString("id"),
                Language = lang,
                Database = db
            };
        }
Пример #7
0
        /// <summary>
        /// Gets a spellchecker for the given language.
        /// </summary>
        /// <param name="options">The configuration to use.</param>
        /// <param name="language">The language to consider.</param>
        /// <returns>The spellchecker or null, if there is none.</returns>
        public static ISpellCheckService GetSpellCheck(this IConfiguration options, String language)
        {
            ISpellCheckService substitute = null;
            var culture = options.GetCultureFromLanguage(language);

            foreach (var spellchecker in options.GetServices <ISpellCheckService>())
            {
                if (spellchecker.Culture.Equals(culture))
                {
                    return(spellchecker);
                }
                else if (spellchecker.Culture.TwoLetterISOLanguageName == culture.TwoLetterISOLanguageName)
                {
                    substitute = spellchecker;
                }
            }

            return(substitute);
        }
Пример #8
0
        public MainLuisDialog(
            BotServices botServices,
            ITeacherService teacherService,
            IOpenDataService openDataService,
            ISearchService searchService,
            ISpellCheckService spellCheckService,
            IUnexFacilitiesService unexFacilitiesService,
            string dialogId = null,
            IEnumerable <WaterfallStep> steps = null) : base(dialogId ?? nameof(MainLuisDialog))
        {
            string fullPath = Path.Combine(new string[] { ".", ".", "Resources", "MainLuisDialog.lg" });

            _lgEngine = Templates.ParseFile(fullPath);

            _services = botServices ?? throw new ArgumentNullException(nameof(botServices));

            if (!_services.LuisServices.ContainsKey(LuisServiceConfiguration.LuisKey))
            {
                throw new ArgumentException($"La configuración no es correcta. Por favor comprueba que existe en tu fichero '.bot' un servicio LUIS llamado '{LuisServiceConfiguration.LuisKey}'.");
            }

            AddDialog(new LanguageNotValidDialog(nameof(LanguageNotValidDialog)));
            AddDialog(new GoodByeDialog(nameof(GoodByeDialog)));
            AddDialog(new HelpDialog(nameof(HelpDialog)));
            AddDialog(new GratitudeDialog(nameof(GratitudeDialog)));
            AddDialog(new NegationDialog(nameof(NegationDialog)));
            AddDialog(new QuestionDialog(nameof(QuestionDialog), botServices, spellCheckService, searchService));
            AddDialog(new SubjectDialog(nameof(SubjectDialog), openDataService));
            AddDialog(new TeacherDialog(nameof(TeacherDialog), teacherService));
            AddDialog(new UnexFacilitiesDialog(nameof(UnexFacilitiesDialog), unexFacilitiesService));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                IntroStepAsync,
                ActStepAsync,
                FinalStepAsync,
            }));

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));

            InitialDialogId = nameof(WaterfallDialog);
        }
 public CognitiveLaunchController(
     IVisionService visionService,
     IAutoSuggestService autoSuggestService,
     IImageSearchService imageSearchService,
     ISpellCheckService spellCheckService,
     IWebSearchService webSearchService,
     INewsSearchService newsSearchService,
     IVideoSearchService videoSearchService,
     IVideoService videoService,
     IEmotionService emotionService,
     IFaceService faceService,
     ILinguisticService linguisticService,
     ITextAnalyticsService textAnalyticsService,
     IEntityLinkingService entityLinkingService,
     IContentModeratorService contentModeratorService,
     IAcademicSearchService academicSearchService,
     IWebLanguageModelService webLanguageModelService,
     ISpeakerIdentificationService speakerIdentificationService,
     ISpeakerVerificationService speakerVerificationService)
 {
     VisionService                = visionService;
     AutoSuggestService           = autoSuggestService;
     ImageSearchService           = imageSearchService;
     SpellCheckService            = spellCheckService;
     WebSearchService             = webSearchService;
     NewsSearchService            = newsSearchService;
     VideoSearchService           = videoSearchService;
     VideoService                 = videoService;
     EmotionService               = emotionService;
     FaceService                  = faceService;
     LinguisticService            = linguisticService;
     TextAnalyticsService         = textAnalyticsService;
     EntityLinkingService         = entityLinkingService;
     ContentModeratorService      = contentModeratorService;
     AcademicSearchService        = academicSearchService;
     WebLanguageModelService      = webLanguageModelService;
     SpeakerIdentificationService = speakerIdentificationService;
     SpeakerVerificationService   = speakerVerificationService;
 }
Пример #10
0
 public GermanLuisDialog(IDeviceDataService deviceDataService,
                         ISpellCheckService spellCheckService,
                         IMessageBuilderService messageBuilderService)
     : base(deviceDataService, spellCheckService, messageBuilderService)
 {
 }
Пример #11
0
 public HomeController(ISpellCheckService service)
 {
     _service = service;
 }
Пример #12
0
 public SpellCheckProccess(ISpellCheckService spellCheckService)
 {
     _spellCheckService = spellCheckService;
 }