/// <summary> /// Constructor. /// </summary> /// <param name="filePath"></param> public Parser(string filePath, Document document) { Doc = document; Stack = new ModeStack(); RtfReader reader = new RtfReader(this); reader.LoadRtfFile(filePath); reader.Parse(); }
/// <summary> /// Constructor. /// </summary> /// <param name="filePath"></param> public Parser(string filePath, Document document) { Doc = document; Stack = new ModeStack(); RtfReader reader = new RtfReader(this); reader.LoadRtfFile(filePath); reader.Parse(); }
public string traducir() { string res = ""; //Construimos nuestro parser MiParser parser = new MiParser(res); //Construimos el RTFReader que tratará el documento a través del SARParser creado anteriormente. reader = new RtfReader(parser); //Cargamos el fichero RTF reader.LoadRtfFile(rutaRTF); //Comenzamos el análisis del documento reader.Parse(); return(parser.doc); }
private static void TagFormat() { string res = ""; MyParser parser = new MyParser(res); RtfReader reader = new RtfReader(parser); reader.LoadRtfFile("..\\..\\testdocs\\test-doc2.rtf"); Console.WriteLine("Processing..."); reader.Parse(); StreamWriter sw = new StreamWriter("..\\..\\testdocs\\taggedfile.txt"); sw.Write(parser.doc); sw.Flush(); sw.Close(); Console.WriteLine("File 'taggedfile.txt' created."); Console.WriteLine(""); }
private static void TagFormat() { string res = ""; MyParser parser = new MyParser(res); RtfReader reader = new RtfReader(parser); reader.LoadRtfFile("..\\..\\testdocs\\test-doc2.rtf"); Console.WriteLine("Processing..."); reader.Parse(); StreamWriter sw = new StreamWriter("..\\..\\testdocs\\taggedfile.txt"); sw.Write(parser.doc); sw.Flush(); sw.Close(); Console.WriteLine("File 'taggedfile.txt' created."); Console.WriteLine(""); }