示例#1
0
        public IActionResult TopMobile()
        {
            IWebsiteCrawler web        = new DigikalaHelper();
            var             sentences  = web.GetTopSentences();
            string          _sentences = "";

            foreach (var item in sentences.Where(x => !string.IsNullOrEmpty(x.Text)))
            {
                foreach (var op in item.Opinions)
                {
                    _sentences += $@"{item.Text.Replace(",", " ").Replace("  ", " ")}	{op.category}_{op.aspect}	{op.polarity}"+ "\r\n";
                }
            }
            return(File(Encoding.UTF8.GetBytes(_sentences), "text/csv", "TopSentences.csv"));
        }