public ActionResult Index(string urls, string words)
        {
            if (urls == "" || words == "")
            {
                return(HttpNotFound());
            }
            AnahtarKelimeSaydirModel model = new AnahtarKelimeSaydirModel();

            model.urls  = StringOperations.GetListBySplit(urls, ',');
            model.words = StringOperations.GetListBySplit(words, ',');
            foreach (var url in model.urls)
            {
                string html = SiteSource.GetHtml(url);
                html = HtmlPack.GetHtmlExludePopup(html);
                string cleanHtml = SiteSource.GetCleanHtml(html).ToLower();
                foreach (var word in model.words)
                {
                    List <string> compatibleWords = new List <string>();
                    compatibleWords = StringOperations.GetLanguageLowerCompatible(word);
                    compatibleWords = StringOperations.GetDifferentWords(compatibleWords);
                    Keyword keyword = new Keyword();
                    keyword.Word  = word;
                    keyword.Url   = url;
                    keyword.Count = 0;
                    foreach (string compatibleWord in compatibleWords)
                    {
                        keyword.Count += StringOperations.GetCountWordInSentence(cleanHtml, compatibleWord);
                    }
                    model.keywords.Add(keyword);
                }
            }
            return(View(model));
        }
 // GET: SiteSiralama
 public ActionResult Index(string urls, string words)
 {
     int counter = 0;
     int depthId1 = 0, depthId2 = 0, depthId3 = 0;
     int id = 0;
     SiteSiralaModel model = new SiteSiralaModel();
     model.Urls = StringOperations.GetListBySplit(urls, ',');
     model.Words = StringOperations.GetListBySplit(words, ',');
     model.Links = new List<string>();
     foreach (var url in model.Urls)
     {
         id++;
         SiteSiralaFunctions.SiteOrderByDepth(url, 1, id, model.Words);
         foreach (var link in SiteSiralaFunctions.links)
         {
             model.Links.Add(link);
         }
         foreach (var subUrlDetail in SiteSiralaFunctions.subUrlDetails)
         {
             model.SubUrlDetails.Add(subUrlDetail);
         }
         SiteSiralaFunctions.ClearValues();
     }
     foreach (var subUrlDetail in model.SubUrlDetails)
     {
         counter++;
         if (subUrlDetail.Depth == 1)
         {
             subUrlDetail.Id = counter;
             depthId1 = subUrlDetail.Id;
             subUrlDetail.ParentId = 0;
         }
         else if (subUrlDetail.Depth == 2)
         {
             subUrlDetail.Id = counter;
             depthId2 = subUrlDetail.Id;
             subUrlDetail.ParentId = depthId1;
         }
         else if (subUrlDetail.Depth == 3)
         {
             subUrlDetail.Id = counter;
             depthId3 = subUrlDetail.Id;
             subUrlDetail.ParentId = depthId2;
         }
     }
     model.SubUrlDetails = SiteSiralaFunctions.GetSubUrlDetailSort(model.SubUrlDetails);
     model.OrgChat = SiteSiralaFunctions.GetOrgChat(model.SubUrlDetails);
     return View(model);
 }
Exemple #3
0
        // GET: SayfaUrlSirala
        public ActionResult Index(string urls, string words)
        {
            SayfaUrlSiralaModel model = new SayfaUrlSiralaModel();

            model.Words = StringOperations.GetListBySplit(words, ',');
            model.Urls  = StringOperations.GetListBySplit(urls, ',');
            foreach (var url in model.Urls)
            {
                UrlDetail urldetail = new UrlDetail();
                urldetail.Url        = url;
                urldetail.SourceHtml = SiteSource.GetHtml(url).ToLower();
                urldetail.SourceHtml = HtmlPack.GetHtmlExludePopup(urldetail.SourceHtml);
                urldetail.CleanHtml  = SiteSource.GetCleanHtml(urldetail.SourceHtml).ToLower();
                foreach (var word in model.Words)
                {
                    Keyword keyword = new Keyword();
                    keyword.Url   = url;
                    keyword.Word  = word;
                    keyword.Count = 0;
                    List <string> languageCompatibles = new List <string>();
                    languageCompatibles = StringOperations.GetLanguageLowerCompatible(word);
                    languageCompatibles = StringOperations.GetDifferentWords(languageCompatibles);
                    foreach (var languageCompatible in languageCompatibles)
                    {
                        keyword.Count += StringOperations.GetCountWordInSentence(urldetail.CleanHtml, languageCompatible);
                    }
                    urldetail.Keywords.Add(keyword);
                }
                List <int> countList = new List <int>();
                foreach (var keyword in urldetail.Keywords)
                {
                    countList.Add(keyword.Count);
                }
                urldetail.PointByCount  = PageRank.GetPointByCount(countList);
                urldetail.PointByMeta   = PageRank.GetPointByMeta(urldetail.SourceHtml, model.Words);
                urldetail.PointByHeader = PageRank.GetPointByHead(urldetail.SourceHtml, model.Words);
                urldetail.PointByTitle  = PageRank.GetPointByTitle(urldetail.SourceHtml, model.Words);
                urldetail.PointSum     += urldetail.PointByCount + urldetail.PointByMeta + urldetail.PointByHeader + urldetail.PointByTitle;
                model.UrlDetails.Add(urldetail);
            }
            model.UrlDetailsAsc  = model.UrlDetails.OrderBy(u => u.PointSum).ToList();
            model.UrlDetailsDesc = model.UrlDetails.OrderByDescending(u => u.PointSum).ToList();
            return(View(model));
        }
Exemple #4
0
        // GET: SemantikAnaliz
        public ActionResult Index(String urls, String words)
        {
            int counter = 0;
            int depthId1 = 0, depthId2 = 0, depthId3 = 0;
            int id = 0;
            SemantikAnalizModel model = new SemantikAnalizModel();

            model.Urls  = StringOperations.GetListBySplit(urls, ',');
            model.Words = StringOperations.GetListBySplit(words, ',');
            List <string> wordList = model.Words;

            foreach (var word in wordList)
            {
                EsAnlamliSozcuk esanlamli = new EsAnlamliSozcuk();
                esanlamli.Source = word;
                esanlamli.Words  = Synonym.GetSynonym(word);
                if (esanlamli.Words != null)
                {
                    esanlamli.WordFirst = esanlamli.Words.First();
                }
                model.Synonyms.Add(esanlamli);
            }
            foreach (var synonym in model.Synonyms)
            {
                model.Words.Add(synonym.WordFirst);
            }
            model.Links = new List <string>();
            foreach (var url in model.Urls)
            {
                id++;
                SiteSiralaFunctions.SiteOrderByDepth(url, 1, id, model.Words);
                foreach (var link in SiteSiralaFunctions.links)
                {
                    model.Links.Add(link);
                }
                foreach (var subUrlDetail in SiteSiralaFunctions.subUrlDetails)
                {
                    model.SubUrlDetails.Add(subUrlDetail);
                }
                SiteSiralaFunctions.ClearValues();
            }
            foreach (var subUrlDetail in model.SubUrlDetails)
            {
                counter++;
                if (subUrlDetail.Depth == 1)
                {
                    subUrlDetail.Id       = counter;
                    depthId1              = subUrlDetail.Id;
                    subUrlDetail.ParentId = 0;
                }
                else if (subUrlDetail.Depth == 2)
                {
                    subUrlDetail.Id       = counter;
                    depthId2              = subUrlDetail.Id;
                    subUrlDetail.ParentId = depthId1;
                }
                else if (subUrlDetail.Depth == 3)
                {
                    subUrlDetail.Id       = counter;
                    depthId3              = subUrlDetail.Id;
                    subUrlDetail.ParentId = depthId2;
                }
            }
            model.SubUrlDetails = SiteSiralaFunctions.GetSubUrlDetailSort(model.SubUrlDetails);
            model.OrgChat       = SiteSiralaFunctions.GetOrgChat(model.SubUrlDetails);
            return(View(model));
        }