Beispiel #1
0
        private List <Chandam> Read()
        {
            List <Chandam> L    = new List <Chandam>();
            string         file = "Sans2.txt";

            int cnt = 0;

            foreach (string line in File.ReadAllLines(file))
            {
                if (cnt == 0)
                {
                    cnt++;
                    continue;
                }


                string[] Cols = line.Split(',');
                //English,DevNagari,Telugu
                //Total Syllables,Lines,Type
                //Syllables ,Sequence

                Chandam C = new Chandam();
                C.EngTitle = Cols[0];
                //C.DevTile = Cols[1];
                C.TelTitle = Cols[2];


                C.TotSyllables = int.Parse(Cols[3]);
                C.Lines        = int.Parse(Cols[4]);
                C.RuleType     = Cols[5];
                C.LineRules    = new List <LineRule>();
                C.LineRules.Add(new LineRule
                {
                    Syllables = int.Parse(Cols[6]),
                    Sequence  = Helper.SequenceToGNames2(Cols[7])
                });
                C.LineRules.Add(new LineRule
                {
                    Syllables = int.Parse(Cols[8]),
                    Sequence  = Helper.SequenceToGNames2(Cols[9])
                });
                C.LineRules.Add(new LineRule
                {
                    Syllables = int.Parse(Cols[10]),
                    Sequence  = Helper.SequenceToGNames2(Cols[11])
                });
                C.LineRules.Add(new LineRule
                {
                    Syllables = int.Parse(Cols[12]),
                    Sequence  = Helper.SequenceToGNames2(Cols[13])
                });

                L.Add(C);
                cnt++;
            }
            return(L);
        }
Beispiel #2
0
        private List <Chandam> Read2()
        {
            List <Chandam> L    = new List <Chandam>();
            string         file = "Tel.txt";

            int cnt = 0;

            foreach (string line in File.ReadAllLines(file))
            {
                if (cnt == 0)
                {
                    cnt++;
                    continue;
                }


                string[] Cols = line.Split(';');
                //kalyaaNa;కల్యాణ;రజజరజరసరలగ;8,13,22;New

                Chandam C = new Chandam();
                C.New          = Cols[4];
                C.Yati         = Cols[3];
                C.EngTitle     = Cols[0].Contains("(") ? Cols[0].Substring(0, Cols[0].IndexOf("(")) : Cols[0];
                C.TelTitle     = Cols[1];
                C.TotSyllables = 0;
                C.Lines        = 4;
                C.RuleType     = "సమవృత్తం";
                C.LineRules    = new List <LineRule>();
                C.LineRules.Add(new LineRule
                {
                    Syllables = 0,
                    Sequence  = ReWrite(Cols[2])
                });
                C.LineRules.Add(new LineRule
                {
                    Syllables = 0,
                    Sequence  = ReWrite(Cols[2])
                });
                C.LineRules.Add(new LineRule
                {
                    Syllables = 0,
                    Sequence  = ReWrite(Cols[2])
                });
                C.LineRules.Add(new LineRule
                {
                    Syllables = 0,
                    Sequence  = ReWrite(Cols[2])
                });


                L.Add(C);
                cnt++;
            }
            return(L);
        }