Пример #1
0
        public void setPageRankModel(PageRankModel model)
        {
            _pageRank          = new PageRankModel();
            _pageRank.urls     = new string[model.urls.Length];
            _pageRank.keywords = model.keywords;

            for (int i = 0; i < model.urls.Length; i++)
            {
                _pageRank.urls[i] = model.urls[i];
            }
        }
Пример #2
0
        public ActionResult Site(PageRankModel model)
        {
            if (ModelState.IsValid)
            {
                handler.setPageRankModel(model);
                handler.clearUrlList();
                handler.rankSites();

                return(Json("success"));
            }

            return(Json("failure"));
        }
Пример #3
0
        public ActionResult getSynonyms(PageRankModel model)
        {
            if (ModelState.IsValid)
            {
                string[] words = model.keywords.Split(' ');

                SynonymModel synonymModel = new SynonymModel();
                synonymModel.keywords  = words;
                synonymModel.synonyms  = handler.semanticAnalysis(model.keywords);
                synonymModel.arraySize = words.Length;

                return(Json(synonymModel, JsonRequestBehavior.AllowGet));
            }

            return(Json("Error", JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public ActionResult RankUrl(PageRankModel model)
        {
            PageRankResultModel[] resultModel = null;

            if (ModelState.IsValid)
            {
                handler.setPageRankModel(model);
                handler.clearUrlList();
                handler.rankPages();
                resultModel = handler.getRankingResults();

                return(Json("success"));
            }

            return(Json("failure"));
        }
Пример #5
0
        public ActionResult Semantic(PageRankModel model)
        {
            if (ModelState.IsValid)
            {
                for (int i = 0; i < model.synonyms.Length; i++)
                {
                    model.keywords += " " + model.synonyms[i];
                }
                handler.setPageRankModel(model);
                handler.clearUrlList();
                handler.rankSites();

                return(Json("Success", JsonRequestBehavior.AllowGet));
            }

            return(Json("Error", JsonRequestBehavior.AllowGet));
        }