示例#1
0
文件: Program.cs 项目: Kotridiy/Task2
        static void Main(string[] args)
        {
            string path = ConfigurationManager.AppSettings.Get("filepath-in");
            Text   text;

            using (FileReader file = new FileReader(path))
            {
                Parser parser = ParserBuilder.GetParser();
                text = parser.Parse(file.Reader);
            }

            path = ConfigurationManager.AppSettings.Get("filepath-out");
            using (FileWriter file = new FileWriter(path))
            {
                text.Serialize(file.Writer);
            }

            //var words = TextManager.GetWordsInQuestions(text, 3);

            /*foreach (var word in words)
             * {
             *  Console.WriteLine(word.GetString());
             * }*/

            /*TextManager.PasteSubstring(text, StringParser.Parse("(: i love you :)"), 7, 3);
             * foreach (var sentence in text)
             * {
             *  Console.WriteLine(sentence.ToString());
             * }*/

            /*foreach (var sentence in TextManager.DeleteWords(text, 3))
             * {
             *  Console.WriteLine(sentence.ToString());
             * }*/
        }
示例#2
0
        public static AbstractParser CreateXMLParser()
        {
            ParserBuilder builder = ParserBuilderFactory.GetParserBuilderFactory().GetParserBuilder(ParserVersions.XMLParserVersion);

            builder.SetUbicationManager(LastVersionVariables.UbicationVersion);
            builder.SetDataFormatManager(LastVersionVariables.SaveDataFormatVersion);
            return(builder.GetParser());
        }
示例#3
0
        public void SetSysteme(ISysteme system)
        {
            this.systeme = system;
            SystemConfiguration configuration = this.systeme.GetConfiguration();
            ParserBuilder       builder       = ParserBuilderFactory.GetParserBuilderFactory().GetParserBuilder(configuration.parserVersion);

            builder.SetUbicationManager(configuration.ubicationVersion);
            builder.SetDataFormatManager(configuration.saveDataVersion);
            this.parser = builder.GetParser();
        }