2 using PdfService.Models;
4 namespace PdfService.Utility
6 public static class TemplateGenerator
8 public static string GetHTMLString(Term[] terms)
10 var sb = new StringBuilder();
16 <section class='hero is-info'>
17 <div class='hero-body' style='padding-left:3em'>
18 <div class='container'>
20 Tweet Sentiment Analysis
28 <div class='container' style='margin-left:3em; margin-right:3em'>
32 foreach (Term term in terms)
35 if(term.Sentiment < 0.33)
37 else if(term.Sentiment < 0.66)
42 sb.AppendFormat(@"<div class='container' style='margin-top:3em;'>
43 <p class='title is-5'>{0}</p>
45 Sentiment Analysis Result:
46 <div class='column'><progress class='progress {2}' value='{1}' max='100'>{1}%</progress></div>
49 </div>", term.Name, System.Math.Ceiling(term.Sentiment*100), color);