Esempio n. 1
0
 static void Main(string[] args)
 {
     if (args.Length < 1)
     {
         usage();
         return;
     }
     try
         {
         if (args[0] == "union")
         {
             TextUniter uni = new TextUniter(args);
             uni.run();
         }
         else if (args[0] == "parse")
         {
             NBParser p = new NBParser(args,0);
             System.Xml.XmlDocument inf=p.getInFile();
             Translator t = new Translator(inf, p.run());
             inf = t.run();
             inf.Save(p.getOutName());
         }
         else if (args[0] == "dump")
         {
             NBParser p = new NBParser(args,1);
             p.dump();
         }
         else
         {
             Console.WriteLine("unknown command " + args[0]);
             usage();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("ERROR: "+ex.Message);
         //Console.ReadKey();
     }
 }
Esempio n. 2
0
 static void Main(string[] args)
 {
     if (args.Length < 1)
     {
         usage();
         return;
     }
     try
     {
         if (args[0] == "union")
         {
             TextUniter uni = new TextUniter(args);
             uni.run();
         }
         else if (args[0] == "parse")
         {
             NBParser p = new NBParser(args, 0);
             System.Xml.XmlDocument inf = p.getInFile();
             Translator             t   = new Translator(inf, p.run());
             inf = t.run();
             inf.Save(p.getOutName());
         }
         else if (args[0] == "dump")
         {
             NBParser p = new NBParser(args, 1);
             p.dump();
         }
         else
         {
             Console.WriteLine("unknown command " + args[0]);
             usage();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("ERROR: " + ex.Message);
         //Console.ReadKey();
     }
 }