<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using DotNetUtils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Templator;

namespace DocGenerate
{
    public static class TemplatorHelpDoc
    {
        private static readonly TemplatorConfig Config = TemplatorConfig.DefaultInstance;

        public static string Title = "Templator";
        public static string Description = "-- An Advanced text templating engine";
        public static IList<Triple<string, string, IDictionary<string, object>[]>> Sections = new List<Triple<string, string, IDictionary<string, object>[]>>
        {
            new Triple<string, string, IDictionary<string, object>[]>("Get Started", "Search for 'Templator' in nuget package manager, current version 1.0.0.5", null),
            new Triple<string, string, IDictionary<string, object>[]>("Philosophy", "Try to Create a text processing engine with the ablity to produce all kinds of formated text using a unified input structure, with the ablity to be fully cusomized in order to overcome any possible symbol conflicts.", null),
            new Triple<string, string, IDictionary<string, object>[]>("Template Usage", "Simply put the a place holder at the position of the text which you what to output, put the desired value inside the input dictionary with the name of the holder as Key, further, the usage of the rich keywords will enable programmer to calculated/validate/re-format against the input value", null),
            new Triple<string, string, IDictionary<string, object>[]>("Syntax of a TextHolder", "With the format of {{HolderName}} or {{Category(HolderName)}} or {{Category(HolderName)[Keyword1(Param1),Keyword2()]}}, simply wrap the holder name with in the begin tag({{) and end tag(}}) will produce a TextHolder, the tags are all customizeable in the config object  ", null),
            new Triple<string, string, IDictionary<string, object>[]>("Build phase validation", "working in progress, there will be a MSBuild task available in nuget package store to enable syntax validation happenning during each project build process", null),
            new Triple<string, string, IDictionary<string, object>[]>("Editor SyntaxHighlighting", "Working in progress, The project 'TemplatorVsExtension' is going to provide syntax highlighting in visual studio. based on TemplatorConfig.xml in the project, in order not get less impact to vs, the extension will only try to parse the active document if the project contains a valid 'TemplatorConfig.xml'", null),
            new Triple<string, string, IDictionary<string, object>[]>("Configuration", "Templator allows to be fully customized through config object, see the following options for details:", GetConfiguableProperties().ToArray()),
        };

        public static IDictionary<string, object> GetInputDict()
        {
            var ret = new Dictionary<string, object>
            {
                {"Title", Title},
                {"Description", Description},
                {"Sections", Sections.Select(s => new Dictionary<string, object>{{"Name", s.First}, {"Description", s.Second}, {"Details", s.Third}}).ToArray()},
                {
                    "Keywords", Config.Keywords.Values.Where(k => k.Description != null).Select(k => new Dictionary<string, object>()
                    {
                        {"Name", k.Name},
                        {"Description", k.Description},
                        {"Params", k.Params.IsNullOrEmpty() ? null : k.Params.Select(p => new Dictionary<string, object>
                            {
                                {"Description",p.First},
                                {"Comments",p.Second},
                            }).ToArray()}
                    }).ToArray()
                }
            };
            return ret;
        }

        private static IEnumerable<IDictionary<string, object>> GetConfiguableProperties()
        {
            return (from p in typeof(TemplatorConfig).GetFields(BindingFlags.Public | BindingFlags.Instance) let d = p.GetCustomAttribute<System.ComponentModel.DescriptionAttribute>() where d != null select new Dictionary<string, object>{{"Name", p.Name}, {"Description", d.Description}}).Cast<IDictionary<string, object>>();
        }
    }
}
<commit_msg>correct typo in project page<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using DotNetUtils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Templator;

namespace DocGenerate
{
    public static class TemplatorHelpDoc
    {
        private static readonly TemplatorConfig Config = TemplatorConfig.DefaultInstance;

        public static string Title = "Templator";
        public static string Description = "-- An Advanced text templating engine";
        public static IList<Triple<string, string, IDictionary<string, object>[]>> Sections = new List<Triple<string, string, IDictionary<string, object>[]>>
        {
            new Triple<string, string, IDictionary<string, object>[]>("Get Started", "Search for 'Templator' in nuget package manager, current version 1.0.0.5", null),
            new Triple<string, string, IDictionary<string, object>[]>("Philosophy", "Try to Create a text processing engine with the ablity to produce all kinds of formated text using a unified input structure, with the ablity to be fully cusomized in order to overcome any possible symbol conflicts.", null),
            new Triple<string, string, IDictionary<string, object>[]>("Template Usage", "Simply put the a place holder at the position of the text which you what to output, put the desired value inside the input dictionary with the name of the holder as Key, further, the usage of the rich keywords will enable programmer to calculated/validate/re-format against the input value", null),
            new Triple<string, string, IDictionary<string, object>[]>("Syntax of a TextHolder", "With the format of {{HolderName}} or {{Category(HolderName)}} or {{Category(HolderName)[Keyword1(Param1),Keyword2()]}}, simply wrap the holder name with in the begin tag({{) and end tag(}}) will produce a TextHolder, the tags are all customizeable in the config object  ", null),
            new Triple<string, string, IDictionary<string, object>[]>("Build phase validation", "working in progress, there will be a MSBuild task available in nuget package store to enable syntax validation happenning during each project build process", null),
            new Triple<string, string, IDictionary<string, object>[]>("Editor SyntaxHighlighting", "Working in progress, The project 'TemplatorVsExtension' is going to provide syntax highlighting in visual studio. based on TemplatorConfig.xml in the project, in order to get less impact to vs performace in regular work, the extension will only try to parse the active document if the project contains a valid 'TemplatorConfig.xml'", null),
            new Triple<string, string, IDictionary<string, object>[]>("Configuration", "Templator allows to be fully customized through config object, see the following options for details:", GetConfiguableProperties().ToArray()),
        };

        public static IDictionary<string, object> GetInputDict()
        {
            var ret = new Dictionary<string, object>
            {
                {"Title", Title},
                {"Description", Description},
                {"Sections", Sections.Select(s => new Dictionary<string, object>{{"Name", s.First}, {"Description", s.Second}, {"Details", s.Third}}).ToArray()},
                {
                    "Keywords", Config.Keywords.Values.Where(k => k.Description != null).Select(k => new Dictionary<string, object>()
                    {
                        {"Name", k.Name},
                        {"Description", k.Description},
                        {"Params", k.Params.IsNullOrEmpty() ? null : k.Params.Select(p => new Dictionary<string, object>
                            {
                                {"Description",p.First},
                                {"Comments",p.Second},
                            }).ToArray()}
                    }).ToArray()
                }
            };
            return ret;
        }

        private static IEnumerable<IDictionary<string, object>> GetConfiguableProperties()
        {
            return (from p in typeof(TemplatorConfig).GetFields(BindingFlags.Public | BindingFlags.Instance) let d = p.GetCustomAttribute<System.ComponentModel.DescriptionAttribute>() where d != null select new Dictionary<string, object>{{"Name", p.Name}, {"Description", d.Description}}).Cast<IDictionary<string, object>>();
        }
    }
}

{'fraction_non_alphanumeric': 0.10470254957507082, 'fraction_numerical': 0.0015864022662889518, 'mean_word_length': 3.1070265239646346, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2258405', 'n_tokens_mistral': 2149, 'n_tokens_neox': 2096, 'n_words': 798}