<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NonClassicLogic
{
    class FuzzyGraph
    {
        private List<FuzzyTrapeze> _list;

        public FuzzyGraph(int count)
        {
            this._list = new List<FuzzyTrapeze>(new FuzzyTrapeze[count]);
        }

        public void addFuzzyTrapeze(int type, FuzzyTrapeze ft)
        {
            this._list[type] = ft;
        }

        public List<double> getFuzzyDistribution(double x)
        {
            List<double> res = new List<double>(new double[this._list.Count]);
            for (int i = 0; i < this._list.Count; ++i) 
            {
                FuzzyTrapeze c = this._list[i];
                if (x <= c.bottomLeft || c.bottomRight <= x)
                {
                    res[i] = 0;
                    continue;
                }

                if (c.topLeft <= x && x <= c.topRight)
                {
                    res[i] = 1;
                    continue;
                }

                if (c.bottomLeft < x && x < c.topLeft)
                {
                    res[i] = (x - c.bottomLeft) / (c.topLeft - c.bottomLeft);
                    continue;
                }

                res[i] = 1 - (x - c.topRight) / (c.bottomRight - c.topRight); <commit_msg>Fix fix`а<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NonClassicLogic
{
    class FuzzyGraph
    {
        private List<FuzzyTrapeze> _list;

        public FuzzyGraph(int count)
        {
            this._list = new List<FuzzyTrapeze>(new FuzzyTrapeze[count]);
        }

        public void addFuzzyTrapeze(int type, FuzzyTrapeze ft)
        {
            this._list[type] = ft;
        }

        public List<double> getFuzzyDistribution(double x)
        {
            List<double> res = new List<double>(new double[this._list.Count]);
            for (int i = 0; i < this._list.Count; ++i) 
            {
                FuzzyTrapeze c = this._list[i];
                if (x < c.bottomLeft || c.bottomRight < x)
                {
                    res[i] = 0;
                    continue;
                }

                if (c.topLeft <= x && x <= c.topRight)
                {
                    res[i] = 1;
                    continue;
                }

                if (c.bottomLeft <= x && x < c.topLeft)
                {
                    res[i] = (x - c.bottomLeft) / (c.topLeft - c.bottomLeft);
                    continue;
                }

                res[i] = 1 - (x - c.topRight) / (c.bottomRight - c.topRight); 
{'fraction_non_alphanumeric': 0.11115227862171174, 'fraction_numerical': 0.0029640607632456465, 'mean_word_length': 1.2462562396006656, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 13, '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': '6806896', 'n_tokens_mistral': 855, 'n_tokens_neox': 782, 'n_words': 169}