<commit_before>using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using BTDB.IL;
using BTDB.ODBLayer;
using BTDB.StreamLayer;
using BTDB.FieldHandler;

namespace BTDB.EventStoreLayer
{
    public class ObjectTypeDescriptor : ITypeDescriptor, IPersistTypeDescriptor
    {
        Type _type;
        readonly string _name;
        readonly List<KeyValuePair<string, ITypeDescriptor>> _fields = new List<KeyValuePair<string, ITypeDescriptor>>();
        readonly ITypeDescriptorCallbacks _typeSerializers;

        public ObjectTypeDescriptor(ITypeDescriptorCallbacks typeSerializers, Type type)
        {
            _typeSerializers = typeSerializers;
            _type = type;
            Sealed = _type.IsSealed;
            _name = typeSerializers.TypeNameMapper.ToName(type);
        }

        public ObjectTypeDescriptor(ITypeDescriptorCallbacks typeSerializers, AbstractBufferedReader reader, Func<AbstractBufferedReader, ITypeDescriptor> nestedDescriptorReader)
        {
            _typeSerializers = typeSerializers;
            Sealed = false;
            _name = reader.ReadString();
            var fieldCount = reader.ReadVUInt32();
            while (fieldCount-- > 0)
            {
                _fields.Add(new KeyValuePair<string, ITypeDescriptor>(reader.ReadString(), nestedDescriptorReader(reader)));
            }
        }

        public bool Equals(ITypeDescriptor other)
        {
            return Equals(other, new HashSet<ITypeDescriptor>(ReferenceEqualityComparer<ITypeDescriptor>.Instance));
        }

        public string Name => _name;

        public bool FinishBuildFromType(ITypeDescriptorFactory factory)
        {
            var props = _type.GetProperties();
            foreach (var propertyInfo in props)
            {
                //if (propertyInfo.GetIndexParameters().Length != 0) continue;
                var descriptor = factory.Create(propertyInfo.PropertyType);
                if (descriptor != null)<commit_msg>Skipping indexer properties when storing Events<commit_after>using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using BTDB.IL;
using BTDB.ODBLayer;
using BTDB.StreamLayer;
using BTDB.FieldHandler;

namespace BTDB.EventStoreLayer
{
    public class ObjectTypeDescriptor : ITypeDescriptor, IPersistTypeDescriptor
    {
        Type _type;
        readonly string _name;
        readonly List<KeyValuePair<string, ITypeDescriptor>> _fields = new List<KeyValuePair<string, ITypeDescriptor>>();
        readonly ITypeDescriptorCallbacks _typeSerializers;

        public ObjectTypeDescriptor(ITypeDescriptorCallbacks typeSerializers, Type type)
        {
            _typeSerializers = typeSerializers;
            _type = type;
            Sealed = _type.IsSealed;
            _name = typeSerializers.TypeNameMapper.ToName(type);
        }

        public ObjectTypeDescriptor(ITypeDescriptorCallbacks typeSerializers, AbstractBufferedReader reader, Func<AbstractBufferedReader, ITypeDescriptor> nestedDescriptorReader)
        {
            _typeSerializers = typeSerializers;
            Sealed = false;
            _name = reader.ReadString();
            var fieldCount = reader.ReadVUInt32();
            while (fieldCount-- > 0)
            {
                _fields.Add(new KeyValuePair<string, ITypeDescriptor>(reader.ReadString(), nestedDescriptorReader(reader)));
            }
        }

        public bool Equals(ITypeDescriptor other)
        {
            return Equals(other, new HashSet<ITypeDescriptor>(ReferenceEqualityComparer<ITypeDescriptor>.Instance));
        }

        public string Name => _name;

        public bool FinishBuildFromType(ITypeDescriptorFactory factory)
        {
            var props = _type.GetProperties();
            foreach (var propertyInfo in props)
            {
                if (propertyInfo.GetIndexParameters().Length != 0) continue;
                var descriptor = factory.Create(propertyInfo.PropertyType);
                if (descriptor != null)
{'fraction_non_alphanumeric': 0.07610789980732177, 'fraction_numerical': 0.0019267822736030828, 'mean_word_length': 2.728007181328546, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '7048899', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1028, 'n_words': 230}