Example #1
0
        public List<List<string>> Analizate(List<List<string>> ListWord)
        {
            Cons cons = new Cons() ;
                Idenfication idef = new Idenfication();
                WRS wrs = new WRS("Ofice.txt","Separation.txt", "Operation.txt");
                bool FlagIsSub=false;
                for (int i = 0; i < ListWord.Count; i++)
                {
                    List<string> currentList = new List<string>();

                    for (int j= 0; j< ListWord[i].Count; j++)
                    {
                        string temp= "";

                        if (FlagIsSub)
                        {
                           temp = idef.GetI(ListWord[i][j]);
                            currentList.Add(temp);
                            FlagIsSub = false;
                            continue;
                        }

                        if ( ListWord[i][j]== "sub")
                        {
                            wrs.GetID("sub", out temp);
                            currentList.Add(temp);
                            FlagIsSub = true;
                            continue;
                        }

                        if (ListWord[i][j][0] == '$' || ListWord[i][j][0] == '&' || ListWord[i][j][0] == '@')
                        {

                            temp = idef.GetI(ListWord[i][j]);
                            currentList.Add(temp);
                            continue;

                        }

                        if (ListWord[i][j][0] == '.' || Char.IsNumber(ListWord[i][j][0]))
                        {
                            temp = cons.GetI(ListWord[i][j]);
                            currentList.Add(temp);
                            continue;
                        }

                        if (wrs.GetID(ListWord[i][j], out temp))
                        {
                            currentList.Add(temp);
                            continue;
                        }

                    }
                    ListWordsDone.Add(currentList);

                }

                cons.WriteDictionary("costants.txt");
                idef.WriteDictionary("identification.txt");
                return  ListWordsDone;
        }