예제 #1
0
        public IActionResult DisplayWord(FormModel model)
        {
            var trigramService = new TrigramService();
            var startingWord   = model.Word;

            //Wait for database response
            var dictionary = _adapter.ConvertTrigramObjectToString(model.Title_);

            var sentence = trigramService.CreateSentenceFromTrigram(dictionary, startingWord);

            ViewBag.Sentence = sentence;
            return(PartialView("Result", sentence));
        }
예제 #2
0
        public IActionResult DisplayWord(FormModel model)
        {
            var trigramService = new TrigramService();
            //TESTING DATA
            string fileName     = model.Title_;
            string text         = System.IO.File.ReadAllText(@"wwwroot/titles/" + fileName);
            var    dictionary   = trigramService.getTrigramsDictionary(text);
            var    startingWord = model.Word;
            ////////////////////////////

            //Wait for database response
            //var dictionary = _contextCallDatabase;

            var sentence = trigramService.CreateSentenceFromTrigram(dictionary, startingWord);

            ViewBag.Sentence = sentence;
            return(View("Index"));
        }