Esempio n. 1
0
        private static string[] SortByName3(string head, PadyamSubType padyamSubType, Rule[] rules)
        {
            string s  = "";
            string s2 = "";



            //if ( head != "" )
            {
                s = s + "<h1>" + head + "</h1>";
                s = s + "<ol>";

                s2 = s2 + "<li>" + head + "</li>";
                s2 = s2 + "<ol>";
            }

            foreach (Rule R in SortHelper.SortByName(rules))
            {
                s  = s + "<li  id='" + R.Identifier + "'>";
                s  = s + BuildHTMLRules(R, true);
                s  = s + "&nbsp; <a class='link' href='#TOP_" + R.Identifier + "'>[TOP]</a>";
                s  = s + "</li>";
                s2 = s2 + "<li id='TOP_" + R.Identifier + "'><a class='identifier' href='#" + R.Identifier + "'>" + R.Name + "</a></li>";
            }


            //if ( head != "" )
            {
                s  = s + "</ol>";
                s2 = s2 + "</ol>";
            }
            return(new string[] { s, s2 });
        }
Esempio n. 2
0
        public static Rule[] OrderedRules()
        {
            //Very  bad way of sorting....
            List <Rule> Rules = new List <Rule>();

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Akkara)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Divpada)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Jati)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Ragada)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Ragada2)))
            {
                Rules.Add(R);
            }
            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Shatpada)))
            {
                Rules.Add(R);
            }


            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.UpaJati)))
            {
                Rules.Add(R);
            }

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.Sisamu)))
            {
                Rules.Add(R);
            }

            for (int i = 1; i <= 27; i++)
            {
                //string cName = Helper.ChandamName(i) + (i <= 26 ? " (" + i + ")" : " (>26)");
                Rule[] VRules = i <= 26 ? RuleHelper.GetRules3(i) : RuleHelper.GetRules4(i);
                foreach (Rule R in SortHelper.SortByName(VRules))
                {
                    Rules.Add(R);
                }
            }

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.DaMDakamu)))
            {
                Rules.Add(R);
            }

            foreach (Rule R in SortHelper.SortByName(RuleHelper.GetRules2(PadyamSubType.VishamaVruttam)))
            {
                Rules.Add(R);
            }

            //Why doing this again??
            Rule[] Rules2 = new Rule[Rules.Count];
            for (int i = 0; i < Rules.Count; i++)
            {
                Rules2[i] = Rules[i];
            }

            return(Rules2);
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="SC"></param>
        /// <returns></returns>
        public static Rule[] GetRules7(SearchCriteria SC)
        {
            Rule[]      Rules = Manager.Rules();
            List <Rule> L     = new List <Rule>();

            foreach (Rule R in Rules)
            {
                if (SC.NameLike.Length > 0)
                {
                    if (
                        R.Identifier.IndexOf(SC.NameLike) >= 0 ||
                        R.Name.IndexOf(SC.NameLike) >= 0
                        //R.Name.IndexOf ( "," + SC.NameLike ) > 0
                        )
                    {
                    }
                    else
                    {
                        continue;
                    }
                }

                if (SC.CharLength > 0)
                {
                    if (!(R.CharLength > 0 && R.Min <= SC.CharLength && SC.CharLength >= R.Max))
                    {
                        continue;
                    }
                }

                if (SC.MatraLength >= 0)
                {
                    if (!(R.MatraLength > 0 && R.MatraLength == SC.MatraLength))
                    {
                        continue;
                    }
                }

                if (SC.MatraSreni.Length > 0)
                {
                    if (!(R.MatraSeries.IndexOf(SC.MatraSreni) == 0))
                    {
                        continue;
                    }
                }

                if (SC.PadyamType != PadyamType.Unspecified)
                {
                    if (!(SC.PadyamType == R.PadyamType))
                    {
                        continue;
                    }
                }


                L.Add(R);
            }

            Rule[] Rules2 = new Rule[L.Count];
            for (int i = 0; i < L.Count; i++)
            {
                Rules2[i] = L[i];
            }
            return(SortHelper.SortByName(Rules2));
        }
Esempio n. 4
0
        public static string BuildBook()
        {
            #region
            //foreach ( Rule R in SortHelper.OrderedRules ( ) )
            //{
            //    s=s+"<li>";
            //    s =s+ BuildHTMLRules ( R ,true);
            //    s = s + "</li>";
            //}
            #endregion

            //Why not going with a Loop...???
            //Should be Something Like this.
            //SortHelper.SortByName2 ( delegate (Rule R)
            //{
            //    return R.PadyamSubType == PadyamSubType.Jati;
            //} );

            string s2 = "<h1>అనుక్రమణిక</h1><ol>";
            string s  = "";

            string[] F = new string[] { };
            F  = SortByName2("జాతులు", PadyamSubType.Jati);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("అక్కరలు", PadyamSubType.Akkara);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("రగడలు", PadyamSubType.Ragada);
            s  = s + F[0];
            s2 = s2 + F[1];


            F  = SortByName2("ముత్యాలసరములు", PadyamSubType.Ragada2);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("షట్పదలు", PadyamSubType.Shatpada);
            s  = s + F[0];
            s2 = s2 + F[1];



            F  = SortByName2("ఉప-జాతులు", PadyamSubType.UpaJati);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("ద్విపదలు", PadyamSubType.Divpada);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("సీసములు", PadyamSubType.Divpada);
            s  = s + F[0];
            s2 = s2 + F[1];



            s  = s + "<h1>వృత్తములు</h1>";
            s2 = s2 + "<li>వృత్తములు</li><ol>";
            for (int i = 1; i <= 27; i++)
            {
                string cName  = Helper.ChandamName(i) + (i <= 26 ? " (" + i + ")" : " (>26)");
                Rule[] VRules = i <= 26 ? RuleHelper.GetRules3(i) : RuleHelper.GetRules4(i);

                s = s + "<h1>" + cName + "</h1>";
                s = s + "<ol>";

                s2 = s2 + "<li>" + cName + "</li>";
                s2 = s2 + "<ol>";
                foreach (Rule R in SortHelper.SortByName(VRules))
                {
                    s  = s + "<li  id='" + R.Identifier + "'>";
                    s  = s + BuildHTMLRules(R, true);
                    s  = s + "&nbsp; <a class='link' href='#TOP_" + R.Identifier + "'>[TOP]</a>";
                    s  = s + "</li>";
                    s2 = s2 + "<li id='TOP_" + R.Identifier + "'><a class='identifier' href='#" + R.Identifier + "'>" + R.Name + "</a></li>";
                }
                s  = s + "</ol>";
                s2 = s2 + "</ol>";
            }
            s2 = s2 + "</ol>";


            F  = SortByName2("దండకములు", PadyamSubType.DaMDakamu);
            s  = s + F[0];
            s2 = s2 + F[1];

            F  = SortByName2("అసమ వృత్తములు", PadyamSubType.VishamaVruttam);
            s  = s + F[0];
            s2 = s2 + F[1];

            s2 = s2 + "</ol>";
            return(s2 + s);
        }