Exemplo n.º 1
0
        public static string BuildResult4(Rule R, Padyam P, MatchResult MR, List <MatchResult> Candidates)
        {
            StringBuilder sb = new StringBuilder();

            if (MR.Percentage != 100)
            {
                sb.AppendLine("<div class='err' style='text-align:center;width:100%;'>" + R.ShortName);
                sb.AppendLine(": <b class='percentage'>" + Number.ParseFloat(MR.Percentage.ToString()).ToFixed() + "%</b>(" + MR.Score + "/" + MR.Total + ")");
                sb.AppendLine("</div>");
            }
            else
            {
                sb.AppendLine("<div class='err Green' style='text-align:center;width:100%;'>");
                sb.AppendLine(R.ShortName);
                sb.AppendLine("</div>");
            }

            if (!R.InfiniteLength)
            {
                sb.AppendLine("<div style='float:left;width:40%;margin-left:10px;'><div class='err'>గణ విభజన</div>");
                sb.AppendLine(P.Build(MR));
                sb.AppendLine("</div>");

                if (MR.Percentage != 100)
                {
                    sb.AppendLine("<div style='float:left;width:50%;margin-right:10px;'><div class='err' style='text-align:right;'>దోషాలు</div>");
                    sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                    sb.AppendLine("</div>");
                }
            }
            else
            {
                if (MR.Percentage != 100)
                {
                    sb.AppendLine("<div style='float:left;width:50%;margin-right:10px;'><div class='err' style='text-align:right;'>దోషాలు</div>");
                    sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                    sb.AppendLine("</div>");
                }

                sb.AppendLine("<div style='float:left;width:40%;margin-left:10px;'><div class='err'>గణ విభజన</div>");
                sb.AppendLine(P.Build(MR));
                sb.AppendLine("</div>");
            }
            return((string)Script.Literal("sb.toString2()", null));
        }
Exemplo n.º 2
0
        public static string Build(MatchResult MR, Rule R, Padyam P, OutputOptions OO)
        {
            StringBuilder sb = new StringBuilder();

            if (MR.Percentage != 100)
            {
                sb.Append("<div style=' margin-top:10px;'>");
                sb.Append("<div class='err10' style='clear:left;text-align:left;width:100%;' tile='" + R.Name + "'>" + (OO.UseFullName ? R.Name : R.ShortName));
                sb.Append(": <b style='color:red'>" + MR.Percentage.ToString("0") + "%</b>(" + MR.Score + "/" + MR.Total + ")");
                sb.AppendLine("</div>");

                sb.AppendLine("<div style='clear:left;float:left;width:50%;margin-right:10px;'>");

                sb.AppendLine("<div style='margin:10px; text-align:left;'>");

                sb.AppendLine("<div class='Err22'>");
                sb.AppendLine(P.Build2(MR));
                sb.AppendLine("</div>");

                sb.AppendLine("<div class='err' style='text-align:right;'>తప్పులు</div>");
                sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                sb.AppendLine("</div>");

                sb.AppendLine("</div>");

                sb.AppendLine("<div style='float:left;width:auto;margin-left:10px;'><div class='err'  style='text-align:right;'>గణ విభజన</div>");
                sb.AppendLine(P.Build(MR));
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");
            }
            else
            {
                if (!OO.ErrorsOnly)
                {
                    sb.Append("<div style=' margin-top:10px;'>");
                    sb.AppendLine("<div class='err10' style='clear:left;text-align:left;width:100%;'>" + R.Name + "</div>");
                    sb.AppendLine("<div style='clear:left;float:left;margin-left:10px;'><div class='Err22'>");
                    sb.AppendLine(P.Build2(MR));
                    sb.AppendLine("</div></div>");
                    sb.AppendLine("</div>");
                }
            }

            return(sb.ToString());
        }
Exemplo n.º 3
0
        public static string Build(MatchResult MR, Rule R, Padyam P, string number, string type)
        {
            StringBuilder sb = new StringBuilder( );

            sb.Append("<div style=' margin-top:10px;'>");
            if (MR.Percentage != 100)
            {
                sb.Append("<div class='err10' style='clear:left;text-align:left;width:100%;'>" + number + ".  " + R.ShortName);
                sb.AppendLine("-<i>" + type + "</i>");
                sb.Append(": <b style='color:red'>" + MR.Percentage.ToString("0") + "%</b>(" + MR.Score + "/" + MR.Total + ")");

                sb.AppendLine("</div>");

                sb.AppendLine("<div style='clear:left;float:left;width:50%;margin-right:10px;'>");
                sb.AppendLine("<div style='margin:10px; text-align:left;'>");
                sb.AppendLine("<div class='Err22'>");
                sb.AppendLine(P.Build2(MR));
                sb.AppendLine("</div>");
                sb.AppendLine("<div class='err' style='text-align:right;'>దోషాలు</div>");
                sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");

                sb.AppendLine("<div style='float:left;width:40%;margin-left:10px;'><div class='err'  style='text-align:right;'>గణ విభజన</div>");
                sb.AppendLine(P.Build(MR));
                sb.AppendLine("</div>");
            }
            else
            {
                sb.AppendLine("<div class='err10' style='clear:left;text-align:left;width:100%;'>" + number + ".  " + R.ShortName + "</div>");
                sb.AppendLine("<div style='clear:left;float:left;margin-left:10px;'><div class='Err22'>");
                sb.AppendLine(P.Build2(MR));
                sb.AppendLine("</div></div>");
            }
            sb.AppendLine("</div");
            return(sb.ToString( ));
        }
Exemplo n.º 4
0
        public static string Build(MatchResult MR, Rule R, Padyam P)
        {
            StringBuilder sb = new StringBuilder();


            {
                sb.Append("<h2 style='color:blue; text-align:left; width:100%;'>" + R.Name);
                if (MR.Percentage != 100)
                {
                    sb.Append(": <b style='color:red'>" + MR.Percentage.ToString("0") + "<span class='symbol'>%</span></b>(" + MR.Score + "/" + MR.Total + ")");
                }
                sb.AppendLine("</h2>");
                sb.AppendLine("<br/>");
                sb.AppendLine("<p style='width:100%; text-align:left;border:1px solid Blue; border-left:4px solid #EEEEEE; '>");
                sb.AppendLine(P.Build2(MR));
                sb.AppendLine("</p>");
                sb.AppendLine("<br/>");

                sb.AppendLine("<br/>");
                sb.AppendLine("<h2 style='color:blue; text-align:center; width:100%;'>గణ విభజన</h2>");
                sb.AppendLine("<br/>");
                sb.AppendLine(P.Build(MR));


                if (MR.Percentage != 100)
                {
                    sb.AppendLine("<br/>");
                    sb.AppendLine("<h2 style='color:blue; text-align:center; width:100%;'>దోషాలు</h2>");
                    sb.AppendLine("<br/>");
                    sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                }
            }


            return(sb.ToString());
        }
Exemplo n.º 5
0
        public static string BuildResult(Rule R, Padyam P, MatchResult MR, List <MatchResult> Candidates)
        {
            StringBuilder sb = new StringBuilder();

            if (MR.Percentage != 100)
            {
                sb.AppendLine("<div class='err' style='text-align:center;width:100%;'>" + R.ShortName);
                sb.AppendLine(": <b style='color:red'>" + MR.Percentage.ToString() + "%</b>(" + MR.Score + "/" + MR.Total + ")");
                sb.AppendLine("</div>");
            }
            else
            {
                sb.AppendLine("<div class='err Green' style='text-align:center;width:100%;'>" + R.ShortName);
                sb.AppendLine("</div>");
            }
            if (MR.Percentage != 100)
            {
                if (!R.InfiniteLength)
                {
                    sb.AppendLine("<div style='float:left;width:40%;margin-left:10px;'><div class='err'>గణ విభజన</div>");
                    sb.AppendLine(P.Build(MR));
                    sb.AppendLine("</div>");

                    sb.AppendLine("<div style='float:left;width:50%;margin-right:10px;'><div class='err' style='text-align:right;'>దోషాలు</div>");
                    sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                    sb.AppendLine("</div>");
                }
                else
                {
                    sb.AppendLine("<div style='float:left;width:50%;margin-right:10px;'><div class='err' style='text-align:right;'>దోషాలు</div>");
                    sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                    sb.AppendLine("</div>");

                    sb.AppendLine("<div style='float:left;width:40%;margin-left:10px;'><div class='err'>గణ విభజన</div>");
                    sb.AppendLine(P.Build(MR));
                    sb.AppendLine("</div>");
                }
            }
            else
            {
                try
                {
                    sb.AppendLine("<div style='float:left;width:40%;margin-left:10px;'><div class='err'>" + R.ShortName + "</div><div class='Err22'>");
                    sb.AppendLine(P.Build2(MR));
                    sb.AppendLine("</div></div>");
                }
                catch
                {
                }

                sb.AppendLine("<div style='float:left;width:58%;margin-right:10px; padding-left:5px;'><div class='err'  style='text-align:right;'>గణ విభజన</div>");
                sb.AppendLine(P.Build(MR));
                sb.AppendLine("</div>");
            }

            if (Candidates != null && MR.Percentage != 100 && Candidates.Count > 1)
            {
                sb.AppendLine("<div style='clear:left; margin-top:10px;'>");
                sb.AppendLine("<div class='err'>సమీప ఫలితాలు</div>");
                sb.AppendLine("<ol>");

                for (int i = 0; i < Candidates.Count; i++)
                {
                    if (i > 5 || i == 0)
                    {
                        continue;
                    }
                    MatchResult _MR = Candidates[i];
                    sb.AppendLine("<li  id='candiate_" + i + "' data='" + _MR.Rule.Identifier + "'>" + _MR.Rule.Name);
                    sb.AppendLine(": <b style='color:red'>" + _MR.Percentage.ToString() + "%</b>");
                    sb.AppendLine("</li>");
                }
                sb.AppendLine("</ol>");

                sb.AppendLine("</div>");
            }

            return(sb.ToString());
        }
Exemplo n.º 6
0
        public static string BuildResult(Rule R, Padyam P, MatchResult MR, List <MatchResult> Candidates)
        {
            bool          handleProse = (Candidates != null);
            StringBuilder sb          = new StringBuilder();

            if (MR.Percentage != 100)
            {
                if (MR.Percentage < 50 && handleProse)
                {
                }
                else
                {
                    sb.AppendLine("<div class='err w100 center'>" + R.Name);
                    sb.AppendLine(": <b class='red'>" + Number.ParseFloat(MR.Percentage.ToString()).ToFixed() + "%</b>(" + MR.Score + "/" + MR.Total + ")");
                    sb.AppendLine("</div>");
                }
            }
            else
            {
                sb.AppendLine("<div class='err Green  w100 center'>" + R.Name);
                sb.AppendLine("</div>");
            }

            if (MR.Percentage != 100)
            {
                if (MR.Percentage < 50 && handleProse)
                {
                    sb.AppendLine("<div class='vachanam'>" + "<div class='err'>కవిత లేదా పాట లేదా వచనము లేదా గద్యము లేదా మరేదైనా ఛందోప్రక్రియ</div>" + "<div class='Err22'>");
                    sb.AppendLine(P.Build3());
                    sb.AppendLine("</div></div>");
                }
                else
                {
                    if (!R.InfiniteLength)
                    {
                        sb.AppendLine("<div class='build'><div class='err'>గణ విభజన</div>");
                        sb.AppendLine(P.Build(MR));
                        sb.AppendLine("</div>");

                        sb.AppendLine("<div class='buildErrors'><div class='err'>దోషాలు</div>");
                        sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                        sb.AppendLine("</div>");
                    }
                    else
                    {
                        sb.AppendLine("<div class='build2'><div class='err'>దోషాలు</div>");
                        sb.AppendLine(MR.ShowErrors(OutputFormat.HTML));
                        sb.AppendLine("</div>");

                        sb.AppendLine("<div  class='buildErrors'><div class='err'>గణ విభజన</div>");
                        sb.AppendLine(P.Build(MR));
                        sb.AppendLine("</div>");
                    }
                }
            }
            else
            {
                try
                {
                    sb.AppendLine("<div class='build'><div class='err'>" + R.ShortName + "</div><div class='Err22'>");
                    sb.AppendLine(P.Build2(MR));
                    sb.AppendLine("</div></div>");
                }
                catch
                {
                }

                sb.AppendLine("<div class='build3'><div class='err right'>గణ విభజన</div>");
                sb.AppendLine(P.Build(MR));
                sb.AppendLine("</div>");
            }

            if (Candidates != null && MR.Percentage != 100 && Candidates.Count >= 1)
            {
                sb.AppendLine("<div class='candidates'>");
                sb.AppendLine("<div class='err'>సమీప ఫలితాలు</div>");
                sb.AppendLine("<ol style='cursor:pointer;' class='num'>");
                for (int i = 0; i < Candidates.Count; i++)
                {
                    if (i > 5 || (i == 0 && MR.Percentage >= 50 && !handleProse))
                    {
                        continue;
                    }
                    MatchResult _MR = Candidates[i];
                    sb.AppendLine("<li  id='candiate_" + i + "' data='" + _MR.Rule.Identifier + "'>" + _MR.Rule.Name);
                    sb.AppendLine(": <b style='color:red'>" + Number.ParseFloat(_MR.Percentage.ToString()).ToFixed() + "%</b>");
                    sb.AppendLine("</li>");
                }
                sb.AppendLine("</ol>");
                sb.Append(Strings.Help);
                sb.AppendLine("</div>");
            }

            return((string)Script.Literal("sb.toString2()", null));
        }