Example #1
0
        private static void Main(string[] args)
        {
            string input_script = @"C:\drojf\large_projects\umineko\umineko_question_repo\InDevelopment\ManualUpdates\0.utf";

            System.IO.StreamReader file = new System.IO.StreamReader(input_script);
            string line;

            CharacterCountInserter characterCountInserter = new CharacterCountInserter();

            int line_count = 0;

            while ((line = file.ReadLine()) != null)
            {
                characterCountInserter.ProcessOneLine(line);
                line_count++;
            }
        }
Example #2
0
        private static void oldMain(string[] args)
        {
            string input_script = @"C:\drojf\large_projects\umineko\umineko_question_repo\InDevelopment\ManualUpdates\0.utf";
            //string output_script = @"C:\drojf\large_projects\umineko\umineko_question_repo\InDevelopment\ManualUpdates\0_new.utf";
            string output_script = @"C:\games\Steam\steamapps\common\Umineko_latest_patch\0.u";

            using (System.IO.StreamReader file = new System.IO.StreamReader(input_script, Encoding.UTF8))
                using (System.IO.StreamWriter outputFile = new System.IO.StreamWriter(output_script, append: false, encoding: Encoding.UTF8))
                {
                    string line;

                    CharacterCountInserter characterCountInserter = new CharacterCountInserter();

                    List <Token>         allTokens       = new List <Token>();
                    List <List <Token> > allTokensByLine = new List <List <Token> >();

                    int line_count = 0;
                    while ((line = file.ReadLine()) != null)
                    {
                        List <Token> tokensOnLine = LineParser.GetAllTokens(line);
                        allTokens.AddRange(tokensOnLine);
                        allTokensByLine.Add(tokensOnLine);
                        line_count++;
                    }


                    //preprocess by line
                    foreach (List <Token> oneLinesTokens in allTokensByLine)
                    {
                        CharacterCountInserter.MarkClickWaitHasNewlineAfterIt(oneLinesTokens);
                    }

                    //preprocess by line, reverse order to set the amount of text each clickwait
                    CharacterCountInserter.MarkCharacterCountOnClickOrPageWaits(allTokens);

                    CharacterCountInserter.StoreLeadingSpacesInClickwaitAndInsertDLE(allTokens);

                    //write out all tokens
                    foreach (Token t in allTokens)
                    {
                        outputFile.Write(t.ToString());
                    }
                }
        }