<commit_before>﻿using StankinsHelperCommands;
using StankinsObjects;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;

namespace Stankins.Interpreter
{
    public class Recipe
    {
        public string Name{get;set;}
        public string Content{get;set;}
        public string Description{get;set;}
        public string[] Arguments {get;set;}
        public WhatToList? WhatToList{get;set;}
    }

    public class RecipeFromFile:Recipe
    {
        public string fileName{get;internal set; }

        public RecipeFromFile(string fileName )
        {
            Name=Path.GetFileNameWithoutExtension(fileName);
            Content= File.ReadAllText(fileName);
            Description =string.Join(Environment.NewLine, File.ReadLines(fileName).Where(it=>it.StartsWith("#")).ToArray());
            this.fileName = fileName;
            var lines=Content.Split(Environment.NewLine,StringSplitOptions.RemoveEmptyEntries);
        }
    }

    public class RecipeFromType: Recipe
    {

        public RecipeFromType(ResultTypeStankins r)
        {
            var args=new List<string>();
            Name="Adv_"+r.Name;
            Content = r.Type.FullName;
            foreach(var item in r.ConstructorParam)
            {
                Content+=$" {item.Key} = {item.Value} ";
                args.Add(item.Key);
            }
            this.Arguments=args.ToArray();
            
            var attr=r.Type.GetCustomAttributes(typeof(DescriptionAttribute),false);
            if(attr?.Length == 1)
            {
                Content=(attr[0] as DescriptionAttribute).Description;
            }
            WhatToList = r.CacheWhatToList;
        }

    }
}<commit_msg>now with a less text<commit_after>﻿using StankinsHelperCommands;
using StankinsObjects;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;

namespace Stankins.Interpreter
{
    public class Recipe
    {
        public string Name{get;set;}
        public string Content{get;set;}
        public string Description{get;set;}
        public string[] Arguments {get;set;}
        public WhatToList? WhatToList{get;set;}
    }

    public class RecipeFromFile:Recipe
    {
        public string fileName{get;internal set; }

        public RecipeFromFile(string fileName )
        {
            Name=Path.GetFileNameWithoutExtension(fileName);
            Content= File.ReadAllText(fileName);
            Description =string.Join(Environment.NewLine, File.ReadLines(fileName).Where(it=>it.StartsWith("#")).ToArray());
            this.fileName = fileName;
            var lines=Content.Split(Environment.NewLine,StringSplitOptions.RemoveEmptyEntries);
        }
    }

    public class RecipeFromType: Recipe
    {

        public RecipeFromType(ResultTypeStankins r)
        {
            var args=new List<string>();
            Name="Adv_"+r.Name;
            Content = r.Type.FullName;
            foreach(var item in r.ConstructorParam)
            {
                Content+=$" {item.Key}={item.Value} ";
                args.Add(item.Key);
            }
            this.Arguments=args.ToArray();
            
            var attr=r.Type.GetCustomAttributes(typeof(DescriptionAttribute),false);
            if(attr?.Length == 1)
            {
                Content=(attr[0] as DescriptionAttribute).Description;
            }
            WhatToList = r.CacheWhatToList;
        }

    }
}
{'fraction_non_alphanumeric': 0.10213980028530671, 'fraction_numerical': 0.0011412268188302425, 'mean_word_length': 2.2076852698993594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1372754', 'n_tokens_mistral': 946, 'n_tokens_neox': 950, 'n_words': 175}