Example #1
0
        private static void processFile(string f, string lang, string title)
        {
            IGraphConsole.WriteLine("Processing file: " + f);

            List <StatisticalGraph> sgList = json_reader.BuildGraphList(f, ops.writeGIF);

            // was there at least one graph in that file?
            if (sgList == null || sgList.Count == 0)
            {
                log.Info("No valid graph to process here.");
            }
            else
            {
                foreach (StatisticalGraph sg in sgList)
                {
                    // Graph cleaning goes first.
                    CleaningManager.CleanGraph(sg);

                    // NLG goes last.
                    if (nlg.Generate(sg))
                    {
                        log.Error("This file has wounded me deeply. Please fix it.");
                    }
                }
            }
        }
Example #2
0
        private static void processFile(string file, string lang, string title)
        {
            string f = Path.GetFullPath(file); // the full path of "file"

            IGraphConsole.WriteLine("Processing file: " + f);

            List <StatisticalGraph> sgList =
                xl_reader.BuildGraphList(f, ops.writeGIF);

            // was there at least one graph in  that Excel file?
            if (sgList == null || sgList.Count == 0)
            {
                log.Info("No valid graph to process here.");
            }
            else
            {
                foreach (StatisticalGraph sg in sgList)
                {
                    if (ops.isCsv)
                    {
                        if (title != null && title.Length > 0)
                        {
                            sg.MainTitle = title;
                        }
                        if (lang != null && lang.Length > 0)
                        {
                            sg.GraphLanguage = lang;
                        }
                    }

                    // Graph cleaning goes first.
                    CleaningManager.CleanGraph(sg);

                    // Writers go second
                    if (ops.writeXML)
                    {
                        log.Debug("Writing graph as XML file.");
                        XMLGraphWriter.write(sg);
                    }

                    // NLG goes last.
                    if (nlg.Generate(sg))
                    {
                        log.Error("This file has wounded me deeply. Please fix it.");
                    }
                }
            }
        }