public BlogMinutoXml GetWordsHighestRelevanceByPostAndTotal(BlogMinutoXml xml) { string text; var listWords = new List <string>(); var listItemXml = new List <ItemXml>(); var itemXml = new ItemXml(); foreach (var item in xml.Channel.Item.Take(10)) { text = FilterHtmlChars(item.ContentEncoded); text = FilterSpaces(text); text = FilterAccentuation(text); text = FilterSpecialCharsAndNumbers(text); listWords = text.Split(" ").ToList(); listWords = FilterArticlesAndPrep(listWords); itemXml = item; itemXml.TotalWord = listWords.Count(); itemXml.CountMostRelevantWords = FilterTopTenWords(listWords); listItemXml.Add(itemXml); } xml.Channel.Item = listItemXml; return(xml); }
private void DoBuildHtml(IReportContext context, IScope scope) { var htmlconfig = new HtmlConfig(); bool standalone = context.Request.Standalone; if (standalone) { htmlconfig.DocHeader = RenderXml(context, scope, DocHeader, null, "DocHeader"); } htmlconfig.Header = RenderXml(context, scope, Header, null, "Header"); htmlconfig.Content = RenderXml(context, scope, Content, null, "Content"); var items = context.Data.arr("items"); IList <ItemXml> xitems = new List <ItemXml>(); if (null != items) { var i = 0; foreach (var item in items) { var itemScope = new Scope(scope); itemScope["_item"] = item; itemScope["_idx"] = i; var xitem = new ItemXml(); xitem.Before = RenderXml(context, itemScope, BeforeItem, item, "BeforeItem"); xitem.Item = RenderXml(context, itemScope, Item, item, "Item"); xitem.After = RenderXml(context, itemScope, AfterItem, item, "AfterItem"); if (null != (xitem.Before ?? xitem.After ?? xitem.Before)) { xitems.Add(xitem); } i++; } } htmlconfig.Items = xitems; htmlconfig.Footer = RenderXml(context, scope, Footer, null, "Footer"); XElement docfooter = null; if (standalone) { htmlconfig.DocFooter = RenderXml(context, scope, DocFooter, null, "DocFooter"); } var xmlhtml = CompileHtml(context, scope, htmlconfig); context.Write(xmlhtml.ToString()); }
private void DoBuildHtml(IReportContext context, IScope scope) { var htmlconfig = new HtmlConfig(); bool standalone = context.Request.Standalone; if (standalone) { htmlconfig.DocHeader = RenderXml(context, scope, DocHeader, null, "DocHeader"); } htmlconfig.Header = RenderXml(context, scope, Header, null, "Header"); htmlconfig.Content = RenderXml(context, scope, Content, null, "Content"); var items = context.Data.arr("items"); IList<ItemXml> xitems = new List<ItemXml>(); if (null != items) { var i = 0; foreach (var item in items) { var itemScope = new Scope(scope); itemScope["_item"] = item; itemScope["_idx"] = i; var xitem = new ItemXml(); xitem.Before = RenderXml(context, itemScope, BeforeItem, item, "BeforeItem"); xitem.Item = RenderXml(context, itemScope, Item, item, "Item"); xitem.After = RenderXml(context, itemScope, AfterItem, item, "AfterItem"); if (null != (xitem.Before ?? xitem.After ?? xitem.Before)) { xitems.Add(xitem); } i++; } } htmlconfig.Items = xitems; htmlconfig.Footer = RenderXml(context, scope, Footer, null, "Footer"); XElement docfooter = null; if (standalone) { htmlconfig.DocFooter = RenderXml(context, scope, DocFooter, null, "DocFooter"); } var xmlhtml = CompileHtml(context, scope, htmlconfig); context.Write(xmlhtml.ToString()); }