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

namespace DavisPutnam.Model
{
    public class Clause
    {
        public HashSet<string> Elements { get; set; }
        public HashSet<string> Vocabulary
        {
            get
            {
                var toReturn = new List<string>(Elements);
                for (var i = 0; i < toReturn.Count; i++)
                {
                    toReturn[i] = toReturn[i].Replace("!", "");
                }
                return new HashSet<string>(toReturn);
            }
        }

        public Clause()
        {
            Elements = new HashSet<string>();
        }

        public void AddElement(string element)
        {
            Elements.Add(element);
        }

        public static Clause Concat(Clause a, Clause b)
        {
            var toReturn = new Clause();
            toReturn.Elements = new HashSet<string>(a.Elements);
            foreach (var s in b.Elements)
            {
                toReturn.AddElement(s);
            }
            return toReturn;
        }

        public bool Tautologia()
        {
            foreach (var s in Vocabulary)
            {
                if (Elements.Contains(s) && Elements.Contains("!" + s))
                {
                    return true;
                }
            }
            return false;
        }

        public Clause Join(Clause join)
        {
            var toReturn = new Clause();
            foreach (var element in Elements)
            {
                if (element.Contains('!'))
                {
                    if (!join.Elements.Contains(element.Replace("!", "")))
                    {
                        toReturn.AddElement(element);
                    }
                }
                else
                {
                    if (!join.Elements.Contains("!" + element))
                    {
                        toReturn.AddElement(element);
                    }
                }
            }
            return toReturn;
        }

        public override string ToString()
        {
            var builder = new StringBuilder();
            builder.Append("{");
            foreach (var s in Elements)
            {
                builder.AppendFormat(" {0},", s);
            }
            builder.Append("}");
            builder.Replace(",}", "}"); 
            return builder.ToString();
        }
    }
}
<commit_msg>Arreglar el Join<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DavisPutnam.Model
{
    public class Clause
    {
        public HashSet<string> Elements { get; set; }
        public HashSet<string> Vocabulary
        {
            get
            {
                var toReturn = new List<string>(Elements);
                for (var i = 0; i < toReturn.Count; i++)
                {
                    toReturn[i] = toReturn[i].Replace("!", "");
                }
                return new HashSet<string>(toReturn);
            }
        }

        public Clause()
        {
            Elements = new HashSet<string>();
        }

        public void AddElement(string element)
        {
            Elements.Add(element);
        }

        public static Clause Concat(Clause a, Clause b)
        {
            var toReturn = new Clause();
            toReturn.Elements = new HashSet<string>(a.Elements);
            foreach (var s in b.Elements)
            {
                toReturn.AddElement(s);
            }
            return toReturn;
        }

        public bool Tautologia()
        {
            foreach (var s in Vocabulary)
            {
                if (Elements.Contains(s) && Elements.Contains("!" + s))
                {
                    return true;
                }
            }
            return false;
        }

        public Clause Join(Clause join)
        {
            var toReturn = new Clause();
            foreach (var element in Elements)
            {
                if (element.Contains('!'))
                {
                    if (!join.Elements.Contains(element.Replace("!", "")))
                    {
                        toReturn.AddElement(element);
                    }
                }
                else
                {
                    if (!join.Elements.Contains("!" + element))
                    {
                        toReturn.AddElement(element);
                    }
                }
            }
            foreach(var element in join.Elements)
            {
                if (element.Contains('!'))
                {
                    if (!Elements.Contains(element.Replace("!", "")))
                    {
                        toReturn.AddElement(element);
                    }
                }
                else
                {
                    if (!Elements.Contains("!" + element))
                    {
                        toReturn.AddElement(element);
                    }
                }
            }
            return toReturn;
        }

        public override string ToString()
        {
            var builder = new StringBuilder();
            builder.Append("{");
            foreach (var s in Elements)
            {
                builder.AppendFormat(" {0},", s);
            }
            builder.Append("}");
            builder.Replace(",}", "}"); 
            return builder.ToString();
        }
    }
}

{'fraction_non_alphanumeric': 0.10212919523637676, 'fraction_numerical': 0.0007217610970768675, 'mean_word_length': 1.0025289017341041, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '4318048', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1278, 'n_words': 284}